Data service control method and related device

ABSTRACT

A data service control method and a related device are disclosed. The method includes: determining, by a PGW, a status of a data service switch of UE; if the status of the data service switch is that the data service switch is turned off, after the PGW receives a first data packet that comes from or goes to the UE, determining, by the PGW, whether the first data packet belongs to a specified type; and forwarding, by the PGW, the first data packet if the first data packet belongs to the specified type; or discarding, by the PGW, the first data packet if the first data packet does not belong to the specified type. During implementation of embodiments of the present disclosure, when the data service switch of the UE is turned off, data traffic of the UE can be saved.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/198,920, filed on Nov. 23, 2018, which is continuation ofInternational Application No. PCT/CN2016/096508, filed on Aug. 24, 2016,which claims priority to International Application No.PCT/CN2016/088585, filed on Jul. 5, 2016 and International ApplicationNo. PCT/CN2016/083378, filed on May 25, 2016. All of the aforementionedpatent applications are hereby incorporated by reference in theirentireties.

TECHNICAL FIELD

The present disclosure relates to the field of communicationstechnologies, and in particular, to a data service control method and arelated device.

BACKGROUND

As a mainstream communications technology, Long Term Evolution (LTE forshort) may provide a faster data service than a second generation (2Gfor short) network and a third generation (3G for short) network do. Inan LTE data service, data packets of various data services are alltransferred on an uplink or downlink data transmission channelestablished between user equipment (UE for short), an access network, acore network, and a packet data network PDN for short).

To avoid an unnecessary data traffic loss caused by a factor such as auser misoperation or malicious software, a data service switch isdisposed for a majority of UEs, and is configured to enable or disable adata service function of the UE. When a user does not need a dataservice, the user may turn off the data service switch. When a userneeds a data service, the user may turn on the data service switch. Whenthe user turns off the data service switch of the UE, the UE usuallyforbids sending a data packet to a network side by using software andhardware methods, and suspends sending uplink data packets of all dataservices of the UE. However, a downlink data packet from the networkside to the UE may still be sent to the UE on the data transmissionchannel. This brings an unnecessary data traffic charge for the UE,causing a waste of data traffic of the UE.

SUMMARY

This application discloses a data service control method and a relateddevice, to save data traffic of UE.

A first aspect discloses a data service control method, including:

determining, by a packet data network gateway PGW, a status of a dataservice switch of user equipment UE, where the status of the dataservice switch includes that the data service switch is turned on orthat the data service switch is turned off;

after the status of the data service switch is that the data serviceswitch is turned off, and the PGW receives a first data packet thatcomes from or goes to the UE,

determining, by the PGW, whether the first data packet belongs to aspecified type; and

forwarding, by the PGW, the first data packet if the first data packetbelongs to the specified type; or discarding, by the PGW, the first datapacket if the first data packet does not belong to the specified type.

After the status of the data service switch of the UE is that the dataservice switch is turned off, the PGW discards an unnecessary datapacket that comes from or goes to the UE, thereby avoiding anunnecessary charge for the UE, and saving data traffic of the UE. Inaddition, the PGW continues to forward a necessary data packet (forexample, a data packet of the specified type) without affecting animportant service and management of an IP address after the data serviceswitch of the UE is turned off.

With reference to the first aspect, in a first implementation of thefirst aspect, before the determining, by the PGW, whether the first datapacket belongs to a specified type, the method further includes:

determining, by the PGW, whether a service registration status of the UEis An IP multimedia subsystem IMS registration state; and when the PGWdetermines that the service registration status of the UE is the IMSregistration state, determining, by the PGW, whether the first datapacket belongs to the specified type.

With reference to the first implementation of the first aspect, in asecond implementation of the first aspect, after the PGW determines thatthe service registration status of the UE is the IMS registration state,the method further includes:

when the status of the data service switch of the UE is that the dataservice switch is turned off, sending, by the PGW, a first statusnotification message to a IP multimedia subsystem IMS network, where thefirst status notification message is used to notify the IMS network thatthe status of the data service switch of the UE is that the data serviceswitch is turned off.

With reference to the first aspect, or the first or the secondimplementation of the first aspect, in a third implementation of thefirst aspect, after the forwarding, by the PGW, the first data packet,the method further includes:

notifying, by the PGW, a charging system that the status of the dataservice switch of the UE is that the data service switch is turned off.

With reference to the third implementation of the first aspect, in afourth implementation of the first aspect, the notifying, by the PGW, acharging system that the status of the data service switch of the UE isthat the data service switch is turned off includes: adding, by the PGW,first indication information to a charging data record CDR generatedaccording to the first data packet, where the first indicationinformation is used to notify the charging system that the data serviceswitch of the UE is turned off; or

notifying, by the PGW in a first credit control request (CCR for short)message, the charging system that the data service switch of the UE isturned off.

With reference to any one of the first aspect or the first to the fourthimplementations of the first aspect, in a fifth implementation of thefirst aspect, the determining, by the PGW, whether the first data packetbelongs to a specified type includes:

determining, by the PGW, whether the first data packet includes one ormore of the following data packets:

an uplink data packet that is sent by the UE to a packet data networkPDN network corresponding to an IMS access point name APN or a downlinkdata packet that is sent by a PDN network corresponding to an IMS APN tothe UE;

a data packet coming from an address of a specified service server andgoing to the UE;

a data packet used to manage an IP address; and

a data packet of a specified service type.

With reference to the fifth implementation of the first aspect, in asixth implementation of the first aspect, the determining, by the PGW,whether the first data packet is a data packet of a specified servicetype includes:

performing, by the PGW, deep packet inspection DPI on the first datapacket, and determining whether the first data packet is the data packetof the specified service type; or

determining, by the PGW based on service type indication informationincluded in the first data packet, whether the first data packet is thedata packet of the specified service type.

With reference to any one of the first aspect or the first to the sixthimplementations of the first aspect, in a seventh implementation of thefirst aspect, after the forwarding, by the PGW, the first data packet ifthe first data packet belongs to the specified type; or discarding, bythe PGW, the first data packet if the first data packet does not belongto the specified type, the method further includes:

after the status of the data service switch is that the data serviceswitch is turned on, and the PGW receives a second data packet thatcomes from or goes to the UE, forwarding, by the PGW, the second datapacket.

With reference to the seventh implementation of the first aspect, in aneighth implementation of the first aspect, after the PGW determines thatthe service registration status of the UE is the IMS registration state,the method further includes:

when the status of the data service switch of the UE is that the dataservice switch is turned on, sending, by the PGW, a second statusnotification message to the IP multimedia subsystem IMS network, wherethe second status notification message is used to notify the IMS networkthat the status of the data service switch of the UE is that the dataservice switch is turned on.

With reference to the seventh or the eighth implementation of the firstaspect, in a ninth implementation of the first aspect, after theforwarding, by the PGW, the second data packet, the method furtherincludes:

notifying, by the PGW, the charging system that the status of the dataservice switch of the UE is that the data service switch is turned on.

With reference to the ninth implementation of the first aspect, in atenth implementation of the first aspect, the notifying, by the PGW, thecharging system that the status of the data service switch of the UE isthat the data service switch is turned on includes:

adding, by the PGW, second indication information to a charging datarecord CDR generated according to the second data packet, where thesecond indication information is used to notify the charging system thatthe data service switch of the UE is turned on; or

notifying, by the PGW in a second CCR message, the charging system thatthe data service switch of the UE is turned on.

A second aspect discloses a data service control method, including:

determining, by a packet data network gateway PGW, a status of a dataservice switch of user equipment UE, where the status of the dataservice switch includes that the data service switch is turned on orthat the data service switch is turned off;

after the status of the data service switch is that the data serviceswitch is turned off, and the PGW receives a first data packet thatcomes from or goes to the UE, determining, by the PGW, whether a serviceregistration status of the UE is only a circuit switched fallback CSFBcombined registration state or only an evolved packet system EPSregistration state, where only the CSFB combined registration stateincludes a state that the UE is registered with both a circuit switchedCS network and an EPS network, but is not registered with an IPmultimedia subsystem IMS network; and

if the service registration status of the UE is only the CSFB combinedregistration state or only the EPS registration state, discarding, bythe PGW, the first data packet.

After the status of the data service switch of the UE is that the dataservice switch is turned off, the PGW discards an unnecessary datapacket that comes from or goes to the UE, thereby avoiding anunnecessary charge for the UE.

A third aspect discloses a data service control method, including:

determining, by a packet data network gateway PGW, a status of a dataservice switch of user equipment UE, where the status of the dataservice switch includes that the data service switch is turned on orthat the data service switch is turned off; and

after the status of the data service switch is that the data serviceswitch is turned off, and the PGW receives a first data packet thatcomes from or goes to the UE, forwarding, by the PGW, the first datapacket, and adding first indication information to a charging datarecord CDR generated according to the first data packet, where the firstindication information is used to notify a charging system that the dataservice switch of the UE is turned off.

After the status of the data service switch of the UE is that the dataservice switch is turned off, the PGW forwards a necessary data packet(for example, a data packet of a specified type) without affecting animportant service and management of an IP address after the data serviceswitch of the UE is turned off. In addition, indication information usedto notify the charging system that the data service switch of the UE isturned off is added to a charging data record CDR generated according tothe forwarded data packet. When the first data packet is forwarded, thePGW may notify the charging system that the data service switch of theUE is turned off, so that the charging system charges for the first datapacket according to a charging standard used after the data serviceswitch of the UE is turned off, and the charging system determineswhether to charge for the first data packet.

With reference to the third aspect, in a first implementation of thethird aspect, before the forwarding, by the PGW, the first data packet,the method further includes:

determining, by the PGW, that a service registration status of the UE isan IMS registration state.

With reference to the third aspect or the first implementation of thethird aspect, in a second implementation of the third aspect, after theforwarding, by the PGW, the first data packet, and adding firstindication information to a charging data record CDR generated accordingto the first data packet, the method further includes:

if the status of the data service switch is that the data service switchis turned on, after the PGW receives a second data packet that comesfrom or goes to the UE,

forwarding, by the PGW, the second data packet, and adding secondindication information to a CDR generated according to the second datapacket, where the second indication information is used to notify thecharging system that the data service switch of the UE is turned on.

After the status of the data service switch of the UE is switched frombeing turned off to being turned on, the PGW may resume an originalcharging operation.

With reference to the third aspect or the first implementation of thethird aspect, in a third implementation of the third aspect, thedetermining, by a PGW, a status of a data service switch of UE includes:

receiving, by the PGW, a protocol configuration option PCO that is sentby the UE by using a mobility management entity MME, where the PCOincludes data service switch status indication information, and the dataservice switch status indication information is used to indicate thestatus of the data service switch of the UE.

The PGW determines the status of the data service switch of the UE basedon the data service switch status indication information in the PCO sentby the UE, and when the status of the data service switch of the UEchanges, the PGW may be notified of the status of the data serviceswitch of the UE in time.

A fourth aspect discloses a data service control method, including:

sending, by UE, a service establishment message to a mobility managemententity MME, where the service establishment message includes dataservice switch status indication information and/or service registrationstatus indication information, the data service switch status indicationinformation is used to indicate a status of a data service switch of theUE to a PGW, the service registration status indication information isused to indicate a service registration status of the UE, and the statusof the data service switch includes that the data service switch isturned on or that the data service switch is turned off.

When a change occurs in the status of the data service switch and/or theservice registration status of the UE, the UE may notify the status ofthe data service switch and/or the service registration status of the UEto the PGW in time.

With reference to the fourth aspect, in a first implementation of thefourth aspect, the method further includes:

when the UE moves from a Long Term Evolution network to a 2/3G network,accessing, by the UE, the 2/3G network; and

when the UE determines that the status of the data service switch of theUE is that the data service switch is turned off,

sending, by the UE, a Packet Data Protocol PDP deactivation message to aserving GPRS support node SGSN of the 2/3G network, to delete a PDPcontext of the UE; or

sending, by the UE, a routing area update message to a serving GPRSsupport node SGSN of the 2/3G network, where the routing area updatemessage carries the status of the data service switch of the UE.

With reference to the first implementation of the fourth aspect, in asecond implementation of the fourth aspect, the method further includes:

when the UE moves from the 2/3G network to the Long Term Evolutionnetwork, accessing, by the UE, the Long Term Evolution network; and

when the UE determines that the status of the data service switch of theUE is that the data service switch is turned off, sending, by the UE, anattach message to the MME.

A fifth aspect discloses a data service control method, including:

sending, by UE, a service establishment message to an MME, where theservice establishment message includes data service switch statusindication information, the data service switch status indicationinformation is used to indicate a status of a data service switch of theUE to a PGW, and the status of the data service switch includes that thedata service switch is turned on or that the data service switch isturned off.

When the status of the data service switch of the UE changes, the UE maynotify the status of the data service switch of the UE to the PGW intime.

With reference to the fifth aspect, in a first implementation of thefifth aspect, the sending, by UE, a service establishment message to anMME includes:

when the UE determines that the status of the data service switchchanges, sending, by the UE, the service establishment message includingthe data service switch status indication information to the MME.

When the status of the data service switch of the UE changes, the UE maynotify the status of the data service switch of the UE to the PGW intime.

With reference to the fifth aspect or the first implementation of thefifth aspect, in a second implementation of the fifth aspect, theservice establishment message includes a protocol configuration optionPCO, where the PCO includes the data service switch status indicationinformation.

The UE may transmit the status of the data service switch of the UE byusing the PCO, thereby improving transmission security.

With reference to the fifth aspect, or the first or the secondimplementation of the fifth aspect, in a third implementation of thefifth aspect, the service establishment message includes one or more ofan attach request message, a bearer resource change message, and a PDNconnection establishment request message.

A sixth aspect discloses a data service control method, including:

after user equipment UE receives an operation instruction for disablinga data service,

sending, by the UE, a packet data network PDN disconnection request to acore network device, so that the core network device deletes another PDNconnection of the UE, where the another PDN connection includes a PDNconnection established by the UE other than a PDN connectioncorresponding to an IP multimedia subsystem IMS access point name APN.

After a data service switch of the UE is turned off, the another PDNconnection is deleted, and only the IMS APN PDN connection is reserved,thereby ensuring that an IMS service can be normally performed.

With reference to the sixth aspect, in a first implementation of thesixth aspect, after the sending, by the UE, a packet data network PDNdisconnection request to a core network device, so that the core networkdevice deletes another PDN connection of the UE, the method furtherincludes:

if the UE does not establish the PDN connection corresponding to the IMSAPN, sending, by the UE, an attach request message to the core networkdevice, to trigger the UE to attach to a Long Term Evolution LTEnetwork, where the attach request message carries indication informationfor requesting to establish the PDN connection corresponding to the IMSAPN, so that the core network device requests, based on the PDNconnection corresponding to the IMS APN, to establish the PDN connectioncorresponding to the IMS APN.

After the another PDN connection of the UE is deleted, if no IMS APN PDNconnection is established, the UE initiates establishment of the IMS APNPDN connection. After the data service switch of the UE is turned off,it is still ensured that the IMS service can be normally performed.

With reference to the sixth aspect or the first implementation of thesixth aspect, in a second implementation of the sixth aspect, after thesending, by the UE, a packet data network PDN disconnection request to acore network device, so that the core network device deletes another PDNconnection of the UE, the method further includes:

if the UE receives an operation instruction for enabling a data service,sending, by the UE, a PDN connection establishment request to the corenetwork device, so that the core network device re-establishes theanother PDN connection.

After a status of the data service switch of the UE is switched frombeing turned off to being turned on, the another PDN connection of theUE is re-established, thereby ensuring that all services are notaffected and can be normally performed after the data service switch ofthe UE is turned on.

With reference to the sixth aspect or the first implementation of thesixth aspect, in a third implementation of the sixth aspect, after thesending, by the UE, a packet data network PDN disconnection request to acore network device, so that the core network device deletes another PDNconnection of the UE, the method further includes:

when the UE needs to send an uplink data packet related to a specifiedservice, if the specified service is based on the another PDNconnection, prompting, by the UE, a user that a current data service hasbeen disabled.

The specified service may be preset by a network-side device (such as anHSS, a P-CSCF, or an AF) and sent to the UE. Alternatively, thespecified service may be preset and stored by the UE based on a serviceregistration status of the UE. After the data service switch of the UEis turned off, if the specified service is based on the another PDNconnection, the user may be prompted in time that the current dataservice has been disabled.

With reference to the third implementation of the sixth aspect, in afourth implementation of the sixth aspect, the method further includes:

after the UE receives an operation instruction for enabling a dataservice, stopping, by the UE, the operation of prompting the user thatthe current data service has been disabled.

After the status of the data service switch of the UE is switched frombeing turned off to being turned on, prompting the user that the currentdata service has been disabled is stopped, and the UE resumes a normaloperation.

With reference to the sixth aspect or the first implementation of thesixth aspect, in a fifth implementation of the sixth aspect, after thesending, by the UE, a packet data network PDN disconnection request to acore network device, so that the core network device deletes another PDNconnection of the UE, the method further includes:

if the UE has established the PDN connection corresponding to the IMSAPN, when the UE needs to send an uplink data packet related to aspecified service, transmitting, by the UE by using the PDN connectioncorresponding to the IMS APN, the uplink data packet related to thespecified service.

After the data service switch of the UE is turned off, if the UE hasestablished the IMS APN PDN connection, the uplink data packet relatedto the specified service may be transmitted by using the IMS APN PDNconnection, thereby ensuring that the specified service can be normallyperformed.

With reference to the fifth implementation of the sixth aspect, in asixth implementation of the sixth aspect, the transmitting, by the UE byusing the PDN connection corresponding to the IMS APN, the uplink datapacket related to the specified service includes:

if the specified service is based on the another PDN connection,modifying, by the UE, a source IP address and a source port number ofthe uplink data packet related to the specified service to a source IPaddress and a source port number that correspond to the PDN connectioncorresponding to the IMS APN, so that a packet data network gateway PGWof the PDN connection corresponding to the IMS APN receives the uplinkdata packet that is related to the specified service and that is sent bythe UE, and sends, based on a destination IP address and a destinationport number of the uplink data packet related to the specified service,the uplink data packet related to the specified service to anapplication server corresponding to the specified service.

After the data service switch of the UE is turned off, if the UE hasestablished the IMS APN PDN connection, the uplink data packet relatedto the specified service may be transmitted by using the IMS APN PDNconnection and by modifying an IP 5-tuple, thereby ensuring that thespecified service can be normally performed.

With reference to the fifth or the sixth implementation of the sixthaspect, in a seventh implementation of the sixth aspect, the methodfurther includes:

after the UE receives the operation instruction for enabling a dataservice, resuming, by the UE, transmission of the uplink data packetrelated to the specified service by using the another PDN connection.

After the status of the data service switch of the UE is switched frombeing turned off to being turned on, the UE resumes a normal operation.

With reference to any one of the sixth aspect or the first to theseventh implementations of the sixth aspect, in an eighth implementationof the sixth aspect, the core network device includes:

a mobility management entity MME, a serving gateway SGW, or a PGW.

A seventh aspect discloses a data service control method, including:

after UE receives an operation instruction for disabling a data service,receiving, by an MME, a PDN disconnection request sent by the UE, anddeleting another PDN connection of the UE, where the another PDNconnection includes a PDN connection established by the UE other than aPDN connection corresponding to an IMS APN; or

receiving, by the MME, a service establishment message sent by the UE,where the service establishment message includes data service switchstatus indication information and/or service registration statusindication information, and forwarding, by the MME, the data serviceswitch status indication information and/or the service registrationstatus indication information to an SGW or a PGW, where the data serviceswitch status indication information is used to indicate a status of adata service switch of the UE, the status of the data service switchincludes that the data service switch is turned on or that the dataservice switch is turned off, and the service registration statusindication information is used to indicate a service registration statusof the UE.

When the data service switch of the UE is turned off, the MME may deletethe another PDN connection of the UE in time. The another PDN connectionincludes the PDN connection established by the UE other than the PDNconnection corresponding to the IMS APN. The MME may alternativelyreceive the service establishment message sent by the UE. The serviceestablishment message includes the data service switch status indicationinformation and/or the service registration status indicationinformation. The MME may further forward the data service switch statusindication information and/or the service registration status indicationinformation to the SGW or the PGW. The MME may notify, in time, a corenetwork device such as the SGW or the PGW that the data service switchof the UE has been turned off.

With reference to the seventh aspect, in a first implementation of theseventh aspect, the receiving, by the MME, a service establishmentmessage sent by the UE, where the service establishment message includesdata service switch status indication information and/or serviceregistration status indication information, and forwarding, by the MME,the data service switch status indication information and/or the serviceregistration status indication information to an SGW or a PGW includes:

receiving, by the MME, an attach request message sent by the UE, wherethe attach request message includes the data service switch statusindication information; and forwarding, by the MME, the data serviceswitch status indication information to the SGW or the PGW, where thedata service switch status indication information is used to notify theSGW or the PGW that a data service of the UE has been disabled.

When the data service switch of the UE is turned off, the MME mayreceive the attach request message that includes the data service switchstatus indication information and that is sent by the UE. The dataservice switch status indication information is used to notify the SGWor the PGW that the data service of the UE has been disabled. The MMEmay notify, in time, the core network device such as the SGW or the PGWthat the data service switch of the UE has been turned off.

With reference to the seventh aspect, in a second implementation of theseventh aspect, the receiving, by the MME, a service establishmentmessage sent by the UE, where the service establishment message includesdata service switch status indication information and/or serviceregistration status indication information, and forwarding, by the MME,the data service switch status indication information and/or the serviceregistration status indication information to an SGW or a PGW includes:

receiving, by the MME, a first bearer resource change message sent bythe UE, where the first bearer resource change message includes dataservice switch status indication information; and forwarding, by theMME, the data service switch status indication information to the SGW orthe PGW, where the data service switch status indication information isused to notify the SGW or the PGW that the data service of the UE hasbeen disabled.

When the data service switch of the UE is turned off, the MME mayreceive the first bearer resource change message that includes the dataservice switch status indication information and that is sent by the UE.The data service switch status indication information is used to notifythe SGW or the PGW that the data service of the UE has been disabled.The MME may notify, in time, the core network device such as the SGW orthe PGW that the data service switch of the UE has been turned off.

With reference to the seventh aspect, in a third implementation of theseventh aspect, the receiving, by the MME, a service establishmentmessage sent by the UE, where the service establishment message includesdata service switch status indication information and/or serviceregistration status indication information, and forwarding, by the MME,the data service switch status indication information and/or the serviceregistration status indication information to an SGW or a PGW includes:

receiving, by the MME, a PDN connection establishment request messagesent by the UE, where the PDN connection establishment request messageincludes data service switch status indication information; andforwarding, by the MME, the data service switch status indicationinformation to the SGW or the PGW, where the data service switch statusindication information is used to notify the SGW or the PGW that thedata service of the UE has been disabled.

When the data service switch of the UE is turned off, the MME mayreceive the PDN connection establishment request message that includesthe data service switch status indication information and that is sentby the UE. The data service switch status indication information is usedto notify the SGW or the PGW that the data service of the UE has beendisabled. The MME may notify, in time, the core network device such asthe SGW or the PGW that the data service switch of the UE has beenturned off.

With reference to any one of the seventh aspect or the first to thethird implementations of the seventh aspect, in a fourth implementationof the seventh aspect, the method further includes:

after the UE receives an operation instruction for enabling a dataservice, receiving, by the MME, a PDN connection establishment requestsent by the UE, to re-establish the another PDN connection.

After the data service switch of the UE is turned on again, the MME mayre-establish the another PDN connection, thereby ensuring that a servicebased on the another PDN connection can be normally performed.

With reference to any one of the seventh aspect or the first to thethird implementations of the seventh aspect, in a fifth implementationof the seventh aspect, after the forwarding, by the MME, the dataservice switch status indication information and/or the serviceregistration status indication information to an SGW or a PGW, themethod further includes:

after the UE receives an operation instruction for enabling a dataservice, receiving, by the MME, a second bearer resource change messagesent by the UE, where the second bearer resource change message includesthe data service switch status indication information; and forwarding,by the MME, the data service switch status indication information to theSGW or the PGW, where the data service switch status indicationinformation is used to notify the SGW or the PGW that the data serviceof the UE has been enabled.

After the data service switch of the UE is turned on, the MME maynotify, in time, the core network device such as the SGW or the PGW thatthe data service switch of the UE has been turned on.

With reference to the first implementation of the seventh aspect, in asixth implementation of the seventh aspect, the receiving, by the MME,an attach request message sent by the UE, where the attach requestmessage includes the data service switch status indication information;and forwarding, by the MME, the data service switch status indicationinformation to the SGW or the PGW includes:

receiving, by the MME, the attach request message sent by the UE, wherethe attach request message includes a PCO, and the PCO carries the dataservice switch status indication information; and forwarding, by theMME, the PCO to the SGW or the PGW, so that the SGW or the PGW obtainsthe data service switch status indication information from the PCO.

After the data service switch of the UE is turned off, the MME maynotify, in time by using the PCO in the attach request message, the corenetwork device such as the SGW or the PGW that the data service switchof the UE has been turned off.

With reference to the second implementation of the seventh aspect, in aseventh implementation of the seventh aspect, the receiving, by the MME,a first bearer resource change message sent by the UE, where the firstbearer resource change message includes data service switch statusindication information; and forwarding, by the MME, the data serviceswitch status indication information to the SGW or the PGW includes:

receiving, by the MME, the first bearer resource change message sent bythe UE, where the first bearer resource change message includes a PCO,and the PCO carries the data service switch status indicationinformation; and forwarding, by the MME, the PCO to the SGW or the PGW,so that the SGW or the PGW obtains the data service switch statusindication information from the PCO.

After the data service switch of the UE is turned off, the MME maynotify, in time by using the PCO in the first bearer resource changemessage, the core network device such as the SGW or the PGW that thedata service switch of the UE has been turned off.

With reference to the third implementation of the seventh aspect, in aneighth implementation of the seventh aspect, the receiving, by the MME,a PDN connection establishment request message sent by the UE, where thePDN connection establishment request message includes data serviceswitch status indication information; and forwarding, by the MME, thedata service switch status indication information to the SGW or the PGWincludes:

receiving, by the MME, the PDN connection establishment request messagesent by the UE, where the PDN connection establishment request messageincludes a PCO, and the PCO carries the data service switch statusindication information; and forwarding, by the MME, the PCO to the SGWor the PGW, so that the SGW or the PGW obtains the data service switchstatus indication information from the PCO.

After the data service switch of the UE is turned off, the MME maynotify, in time by using the PCO in the PDN connection establishmentrequest message, the core network device such as the SGW or the PGW thatthe data service switch of the UE has been turned off.

An eighth aspect discloses a PGW, including a processor and a networkinterface, where

the network interface is configured to receive a first data packet thatcomes from or goes to UE;

the processor is configured to determine a status of a data serviceswitch of the user equipment UE, where the status of the data serviceswitch includes that the data service switch is turned on or that thedata service switch is turned off;

the processor is further configured to: after the processor determinesthat the status of the data service switch is that the data serviceswitch is turned off, and the network interface receives the first datapacket that comes from or goes to the UE, determine whether the firstdata packet belongs to a specified type;

the processor is further configured to forward the first data packetwhen the processor determines that the first data packet belongs to thespecified type; and

the processor is further configured to discard the first data packetwhen the processor determines that the first data packet does not belongto the specified type.

With reference to the eighth aspect, in a first implementation of theeighth aspect, before the processor determines whether the first datapacket belongs to the specified type, the processor is furtherconfigured to determine whether a service registration status of the UEis an IP multimedia subsystem IMS registration state; and when the PGWdetermines that the service registration status of the UE is the IMSregistration state, the processor determines whether the first datapacket belongs to the specified type.

With reference to the first implementation of the eighth aspect, in asecond implementation of the eighth aspect, the processor is furtherconfigured to: after the processor determines that the serviceregistration status of the UE is the IMS registration state, when thestatus of the data service switch of the UE is that the data serviceswitch is turned off, send a first status notification message to a IPmultimedia subsystem IMS network by using the network interface, wherethe first status notification message is used to notify the IMS networkthat the status of the data service switch of the UE is that the dataservice switch is turned off.

With reference to the eighth aspect, or the first or the secondimplementation of the eighth aspect, in a third implementation of theeighth aspect, the processor is further configured to:

after the processor forwards the first data packet, notify, by using thenetwork interface, a charging system that the status of the data serviceswitch of the UE is that the data service switch is turned off.

With reference to the third implementation of the eighth aspect, in afourth implementation of the eighth aspect, a manner used by theprocessor to notify, by using the network interface, the charging systemthat the status of the data service switch of the UE is that the dataservice switch is turned off is in some embodiments:

adding, by the processor, first indication information to a chargingdata record CDR generated according to the first data packet, where thefirst indication information is used to notify the charging system thatthe data service switch of the UE is turned off; or

notifying, by the processor in a first credit control request CCRmessage, the charging system that the data service switch of the UE isturned off.

With reference to any one of the eighth aspect or the first to thefourth implementations of the eighth aspect, in a fifth implementationof the eighth aspect, that the processor determines whether the firstdata packet belongs to the specified type is in some embodiments:

the processor determines whether the first data packet includes one ormore of the following data packets:

an uplink data packet that is sent by the UE to a packet data networkPDN network corresponding to an IMS access point name APN or a downlinkdata packet that is sent by a PDN network corresponding to an IMS APN tothe UE;

a data packet coming from an address of a specified service server andgoing to the UE;

a data packet used to manage an IP address; and

a data packet of a specified service type.

With reference to the fifth implementation of the eighth aspect, in asixth implementation of the eighth aspect, that the processor determineswhether the first data packet is the data packet of the specifiedservice type is in some embodiments:

the processor performs deep packet inspection DPI on the first datapacket, and determines whether the first data packet is the data packetof the specified service type; or

the processor determines, based on service type indication informationincluded in the first data packet, whether the first data packet is thedata packet of the specified service type.

With reference to any one of the eighth aspect or the first to the sixthimplementations of the eighth aspect, in a seventh implementation of theeighth aspect, the network interface is further configured to receive asecond data packet that comes from or goes to the UE; and

the processor is further configured to: after the processor determinesthat the status of the data service switch is switched from the statethat the data service switch is turned off to the state that the dataservice switch is turned on, and the network interface receives thesecond data packet that comes from or goes to the UE, forward the seconddata packet.

With reference to the seventh implementation of the eighth aspect, in aneighth implementation of the eighth aspect, the processor is furtherconfigured to:

after the processor determines that the service registration status ofthe UE is the IMS registration state, when the status of the dataservice switch of the UE is that the data service switch is turned on,send a second status notification message to the IP multimedia subsystemIMS network by using the network interface, where the second statusnotification message is used to notify the IMS network that the statusof the data service switch of the UE is that the data service switch isturned on.

With reference to the seventh or the eighth implementation of the eighthaspect, in a ninth implementation of the eighth aspect, the processor isfurther configured to: after forwarding the second data packet, notify,by using the network interface, the charging system that the status ofthe data service switch of the UE is that the data service switch isturned on.

With reference to the ninth implementation of the eighth aspect, in atenth implementation of the eighth aspect, a manner used by theprocessor to notify, by using the network interface, the charging systemthat the status of the data service switch of the UE is that the dataservice switch is turned on is in some embodiments:

adding, by the processor, second indication information to a chargingdata record CDR generated according to the second data packet, where thesecond indication information is used to notify the charging system thatthe data service switch of the UE is turned on; or

notifying, by the processor in a second CCR message, the charging systemthat the data service switch of the UE is turned on.

A ninth aspect discloses a PGW, including a processor and a networkinterface, where

the network interface is configured to receive a first data packet thatcomes from or goes to UE;

the processor is configured to determine a status of a data serviceswitch of the user equipment UE;

the processor is further configured to: after the processor determinesthat the status of the data service switch is that the data serviceswitch is turned off, and the network interface receives the first datapacket that comes from or goes to the UE, determine whether a serviceregistration status of the UE is only a circuit switched fallback CSFBcombined registration state or only an evolved packet system EPSregistration state; and

the processor is further configured to: when the processor determinesthat the service registration status of the UE is only the CSFB combinedregistration state or only the EPS registration state, discard the firstdata packet, where

the status of the data service switch includes that the data serviceswitch is turned on or that the data service switch is turned off, andonly the CSFB combined registration state includes a state that the UEis registered with both a circuit switched CS network and an EPSnetwork, but is not registered with an IP multimedia subsystem IMSnetwork.

A tenth aspect discloses a PGW, including a processor and a networkinterface, where

the network interface is configured to receive a first data packet thatcomes from or goes to UE;

the processor is configured to determine a status of a data serviceswitch of the user equipment UE, where the status of the data serviceswitch includes that the data service switch is turned on or that thedata service switch is turned off; and

the processor is further configured to: after the status of the dataservice switch is that the data service switch is turned off, and thenetwork interface receives the first data packet that comes from or goesto the UE, forward the first data packet, and add first indicationinformation to a charging data record CDR generated according to thefirst data packet, where the first indication information is used tonotify a charging system that the data service switch of the UE isturned off.

With reference to the tenth aspect, in a first implementation of thetenth aspect, the processor is further configured to: before forwardingthe first data packet, determine that a service registration status ofthe UE is an IMS registration state.

With reference to the tenth aspect or the first implementation of thetenth aspect, in a second implementation of the eighth aspect, thenetwork interface is further configured to receive a second data packetthat comes from or goes to the UE; and

the processor is further configured to: after the status of the dataservice switch is that the data service switch is turned on, and thenetwork interface receives the second data packet that comes from orgoes to the UE, forward the second data packet, and add secondindication information to a CDR generated according to the second datapacket, where the second indication information is used to notify thecharging system that the data service switch of the UE is turned on.

With reference to the tenth aspect or the first implementation of thetenth aspect, in a third implementation of the tenth aspect, that theprocessor determines the status of the data service switch of the UE isin some embodiments:

the processor receives a protocol configuration option PCO that is sentby the UE by using a mobility management entity MME, where the PCOincludes data service switch status indication information, and the dataservice switch status indication information is used to indicate thestatus of the data service switch of the UE.

An eleventh aspect discloses UE, including a processor and a networkinterface, where

the network interface is configured to send a service establishmentmessage to an MME; and

the processor is configured to send the service establishment message tothe MME by using the network interface, where

the service establishment message includes data service switch statusindication information and/or service registration status indicationinformation, the data service switch status indication information isused to indicate a status of a data service switch of the UE to a PGW,the service registration status indication information is used toindicate a service registration status of the UE, and the status of thedata service switch includes that the data service switch is turned onor that the data service switch is turned off.

With reference to the eleventh aspect, in a first implementation of theeleventh aspect,

when the UE moves from a Long Term Evolution network to a 2/3G network,the UE accesses the 2/3G network; and

when the processor determines that the status of the data service switchof the UE is that the data service option is turned off, the UE sends aPacket Data Protocol PDP deactivation message to a serving GPRS supportnode SGSN of the 2/3G network by using the network interface, to deletea PDP context of the UE; or

the UE sends a routing area update message to a serving GPRS supportnode SGSN of the 2/3G network by using the network interface, where therouting area update message carries the status of the data serviceoption of the UE.

With reference to the first implementation of the eleventh aspect, in asecond implementation of the eleventh aspect,

when the UE moves from the 2/3G network to the Long Term Evolutionnetwork, the UE accesses the Long Term Evolution network; and

when the processor determines that the status of the data service switchof the UE is that the data service option is turned off, the UE sends anattach message to the MME by using the network interface.

A twelfth aspect discloses UE, including a processor and a networkinterface, where

the network interface is configured to send a service establishmentmessage to an MME; and

the processor is configured to send the service establishment message tothe MME by using the network interface, where

the service establishment message includes data service switch statusindication information, the data service switch status indicationinformation is used to indicate a status of a data service switch of theUE to a PGW, and the status of the data service switch includes that thedata service switch is turned on or that the data service switch isturned off.

With reference to the twelfth aspect, in a first implementation of thetwelfth aspect, the processor is further configured to determine whetherthe status of the data service switch of the UE changes; and

that the processor sends the service establishment message to the MME byusing the network interface is in some embodiments:

when the processor determines that the status of the data service switchchanges, the processor sends, by using the network interface, theservice establishment message including the data service switch statusindication information to the MME.

With reference to the twelfth aspect or the first implementation of thetwelfth aspect, in a second implementation of the twelfth aspect, theservice establishment message includes a protocol configuration optionPCO, where the PCO includes the data service switch status indicationinformation.

With reference to the twelfth aspect, or the first or the secondimplementation of the twelfth aspect, in a third implementation of thetwelfth aspect, the service establishment message includes one or moreof an attach request message, a bearer resource change message, and aPDN connection establishment request message.

A thirteenth aspect discloses a data service control method, including:

after a packet data network gateway PGW receives a first data packetthat comes from or goes to user equipment UE, forwarding, by the PGW,the first data packet;

determining, by the PGW, whether the first data packet belongs to aspecified type; and

if the first data packet belongs to the specified type, adding, by thePGW, fourth indication information to a charging data record CDRgenerated according to the first data packet, where the fourthindication information is used to instruct a charging system not tocharge for the first data packet.

With reference to the thirteenth aspect, in a first implementation ofthe thirteenth aspect, the determining, by the PGW, whether the firstdata packet belongs to a specified type includes:

determining, by the PGW, whether the first data packet includes one ormore of the following data packets:

an uplink data packet that is sent by the UE to a packet data networkPDN network corresponding to an IMS access point name APN or a downlinkdata packet that is sent by a PDN network corresponding to an IMS APN tothe UE;

a data packet coming from an address of a specified service server andgoing to the UE;

a data packet used to manage an IP address; and

a data packet of a specified service type.

With reference to the first implementation of the thirteenth aspect, ina second implementation of the thirteenth aspect, the determining, bythe PGW, whether the first data packet is a data packet of a specifiedservice type includes:

performing, by the PGW, deep packet inspection DPI on the first datapacket, and determining whether the first data packet is the data packetof the specified service type; or

determining, by the PGW based on service type indication informationincluded in the first data packet, whether the first data packet is thedata packet of the specified service type.

With reference to the thirteenth aspect, or the first or the secondimplementation of the thirteenth aspect, in a third implementation ofthe thirteenth aspect, before the forwarding, by the PGW, the first datapacket, the method further includes:

determining, by the PGW, that a status of a data service switch of theuser equipment UE is that the data service switch is turned off.

With reference to the third implementation of the thirteenth aspect, ina fourth implementation of the thirteenth aspect, after the determining,by the PGW, that a status of a data service switch of the user equipmentUE is that the data service switch is turned off, the method furtherincludes:

adding, by the PGW, first indication information to the charging datarecord CDR generated according to the first data packet, where the firstindication information is used to notify the charging system that thedata service switch of the UE is turned off.

A fourteenth aspect discloses a PGW, including a processor and a networkinterface, where

the network interface is configured to receive a first data packet thatcomes from or goes to user equipment UE;

the processor is configured to forward the first data packet;

the processor is further configured to determine whether the first datapacket belongs to a specified type; and

the processor is further configured to: when the first data packetbelongs to the specified type, add fourth indication information to acharging data record CDR generated according to the first data packet,where the fourth indication information is used to instruct a chargingsystem not to charge for the first data packet.

With reference to the fourteenth aspect, in a first implementation ofthe fourteenth aspect, before the processor forwards the first datapacket, the processor is further configured to determine whether thefirst data packet includes one or more of the following data packets:

an uplink data packet that is sent by the UE to a packet data networkPDN network corresponding to an IMS access point name APN or a downlinkdata packet that is sent by a PDN network corresponding to an IMS APN tothe UE;

a data packet coming from an address of a specified service server andgoing to the UE;

a data packet used to manage an IP address; and

a data packet of a specified service type.

With reference to the fourteenth aspect or the first implementation ofthe fourteenth aspect, in a second implementation of the fourteenthaspect, a manner used by the processor to determine whether the firstdata packet is the data packet of the specified service type is in someembodiments:

performing, by the processor, deep packet inspection DPI on the firstdata packet, and determining whether the first data packet is the datapacket of the specified service type; or

determining, by the processor based on service type indicationinformation included in the first data packet, whether the first datapacket is the data packet of the specified service type.

With reference to the fourteenth aspect, or the first or the secondimplementation of the fourteenth aspect, in a third implementation ofthe fourteenth aspect, the processor is further configured to: beforeforwarding the first data packet, determine that a status of a dataservice switch of the user equipment UE is that the data service switchis turned off.

With reference to the third implementation of the fourteenth aspect, ina fourth implementation of the fourteenth aspect,

the processor is further configured to: after determining that thestatus of the data service switch of the user equipment UE is that thedata service switch is turned off, add first indication information to acharging data record CDR generated according to the first data packet,where the first indication information is used to notify the chargingsystem that the data service switch of the UE is turned off.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of thisapplication more clearly, the following briefly describes theaccompanying drawings required for the embodiments. Apparently, theaccompanying drawings in the following description show merely someembodiments of this application, and persons of ordinary skill in theart may still derive other drawings from these accompanying drawingswithout creative efforts.

FIG. 1 is a schematic diagram of a network architecture according to anembodiment of this application;

FIG. 2a is a schematic flowchart of a data service control methodaccording to an embodiment of this application;

FIG. 2b is a schematic flowchart of another data service control methodaccording to an embodiment of this application;

FIG. 2c is a schematic flowchart of another data service control methodaccording to an embodiment of this application;

FIG. 3 is a schematic flowchart of another data service control methodaccording to an embodiment of this application;

FIG. 4 is a schematic flowchart of another data service control methodaccording to an embodiment of this application;

FIG. 4a is a schematic flowchart of another data service control methodaccording to an embodiment of this application;

FIG. 4b is a schematic flowchart of another data service control methodaccording to an embodiment of this application;

FIG. 5 is a schematic flowchart of another data service control methodaccording to an embodiment of this application;

FIG. 6 is a schematic structural diagram of UE according to anembodiment of this application;

FIG. 7 is a schematic structural diagram of a PGW according to anembodiment of this application;

FIG. 7a is a schematic structural diagram of another PGW according to anembodiment of this application;

FIG. 7b is a schematic structural diagram of another PGW according to anembodiment of this application; and

FIG. 8 is a schematic structural diagram of another UE according to anembodiment of this application.

DESCRIPTION OF EMBODIMENTS

To better understand embodiments of this application, a networkarchitecture disclosed in an embodiment of this application is firstdescribed below. Referring to FIG. 1, FIG. 1 is a schematic diagram ofthe network architecture according to the embodiment of thisapplication. As shown in FIG. 1, the network architecture includes userequipment (UE for short) 101, an evolved universal terrestrial radioaccess network (E-UTRAN for short) 102, a serving gateway (SGW forshort) 103, a packet data network gateway (PGW for short) 104, anexternal packet data network (PDN for short) 105, a policy and chargingrules function (PCRF for short) 106, a mobility management entity (MMEfor short) 107, home subscriber server (HSS for short) 108, and aserving GPRS support node (SGSN for short) 109. In an LTE data service,data packets of various data services are all transmitted on an uplinkor downlink data transmission channel established between the userequipment 101, the evolved universal terrestrial radio access network102, the serving gateway 103, the packet data network gateway 104, andthe external packet data network 105.

Referring to FIG. 2a , FIG. 2a is a schematic flowchart of a dataservice control method according to an embodiment of this application.As shown in FIG. 2a , the method includes the following steps.

201: A packet data network gateway PGW determines a status of a dataservice switch of user equipment UE, where the status of the dataservice switch includes that the data service switch is turned on orthat the data service switch is turned off.

In this embodiment of this application, the UE is user equipment thathas been registered with a Long Term Evolution LTE network. That apacket data network gateway determines a status of a data service ofuser equipment may be: receiving, by the PGW, indication informationthat indicates the status of the data service switch of the UE and thatis sent by the UE, and obtaining the status of the data service switchof the UE from the indication information. In a specific scenario, forexample, when UE receives a user operation of disabling a data service(for example, when a user turns off a data service switch of the UE),the UE sends, to an mobility management entity (MME), indicationinformation indicating a status of the data service switch of the UE.The MME forwards the indication information to a serving gateway. TheSGW forwards the indication information to a PGW. The PGW obtains thestatus of the data service switch of the UE from the indicationinformation. The status of the data service switch includes that thedata service switch is turned on or that the data service switch isturned off. The data service switch is also referred to as a dataswitch.

In some embodiments, step 201 may include:

receiving, by the PGW, a protocol configuration option (PCO) sent by theUE by using the MME, where the PCO includes data service switch statusindication information, and the data service switch status indicationinformation is used to indicate the status of the data service switch ofthe UE.

In this embodiment of this application, the UE may send a serviceestablishment message (the service establishment message may be anattach request message, a bearer resource change message, a PDNconnection establishment request message, or the like) to the MME. Theservice establishment message includes the data service switch statusindication information, and the data service switch status indicationinformation is used to indicate the status of the data service switch ofthe UE. In some embodiments, the UE may add the data service switchstatus indication information to the protocol configuration option (PCOfor short) sent to the MME, and the data service switch statusindication information is used to indicate the status of the dataservice switch of the UE. The MME transparently transmits (transparenttransmission means that the PCO is not processed in a transmissionprocess) the PCO to the SGW by using the service establishment message.The SGW then transparently transmits the PCO to the PGW by using theservice establishment message. After obtaining the PCO, the PGW obtainsthe data service switch status indication information carried in thePCO. In this way, the PGW learns of the status of the data serviceswitch of the UE. In some embodiments, the PCO may be encrypted, therebyimproving security of the transparent transmission of the PCO. Forexample, the PCO may be encrypted by using identity information (such asa username or a password) of a user. The PGW determines the status ofthe data service switch of the UE based on the data service switchstatus indication information in the PCO sent by the UE, and when thedata service switch of the UE changes, the PGW may be notified of thestatus of the data service switch of the UE in time.

202: When the status of the data service switch is that the data serviceswitch is turned off, and the PGW receives a first data packet thatcomes from or goes to the UE, the PGW determines whether the first datapacket belongs to a specified type; and if yes, perform step 203; or ifno, perform step 204.

In some embodiments, after the PGW determines that a serviceregistration status of the UE is an IMS registration state, when thestatus of the data service switch of the UE is that the data serviceswitch is turned off, the PGW sends a first status notification messageto an IP multimedia subsystem IMS network. The first status notificationmessage is used to notify the IMS network that the status of the dataservice switch of the UE is that the data service switch is turned off.

In some embodiments, that the PGW sends a first status notificationmessage to the IPIP multimedia subsystem IMS network may be in someembodiments:

the PGW first sends the first status notification message to a policyand charging rules function (PCRF for short), and the PCRF then forwardsthe first status notification message to the IPIP multimedia subsystemIMS network.

The PGW may notify the status of the data service switch of the UE tothe IMS network, so that the IMS network determines, based on the statusof the data service switch of the UE, whether to continue sending datato the UE.

203: The PGW forwards the first data packet.

204: The PGW discards the first data packet.

In this embodiment of this application, after the status of the dataservice switch of the UE is that the data service switch is turned off,and the PGW receives the first data packet that comes from or goes tothe UE, the PGW forwards or discards the first data packet based on atype of the first data packet. In some embodiments, the PGW determineswhether the first data packet belongs to the specified type. If thefirst data packet belongs to the specified type, the PGW forwards thefirst data packet; or if the first data packet does not belong to thespecified type, the PGW discards the first data packet. The specifiedtype may include an uplink data packet that is sent by the UE to a PDNnetwork corresponding to an IMS APN or a downlink data packet that issent by a PDN network corresponding to an IMS APN to the UE, a datapacket coming from an address of a specified service server (forexample, an address of a rich communication suite RCS server) and goingto the UE, a data packet used to manage an IP address, a data packet ofa specified service type (such as a voice over LTE VoLTE service or arich communication suite RCS service), and the like. The specified typemay be preset by the UE or a network-side device (such as a homesubscriber server HSS, a proxy-call session control function P-CSCF, oran application function AF) and sent to the PGW, or may be preset andstored by the PGW based on the service registration status of the UE.

In some embodiments, the data packet of the specified type may be one ora combination of the following four:

(1) An uplink data packet that is sent by the UE to a packet datanetwork PDN network corresponding to an IMS access point name APN or adownlink data packet that is sent by a PDN network corresponding to anIMS APN to the UE, in other words, an uplink or downlink data packet ofan IMS service of the UE. To ensure that the IMS service can be normallyperformed, after the data service switch of the UE is turned off, thePGW continues forwarding the uplink or downlink data packet of the IMSservice.

(2) A data packet coming from an address of a specified service server(for example, an address of a rich communication suite RCS server) andgoing to the UE. The address of the specified service server may bepreset by the UE or the PGW and is stored in the PGW. The PGW determineswhether a source address of the first data packet is the prestoredaddress of the specified service server, and if yes, determines that thefirst data packet belongs to the specified type.

(3) A data packet used to manage an IP address.

The data packet used to manage an IP address is a data packet used tomanage an IP address, allocate an IP address, and the like. For example,the data packet may be a Dynamic Host Configuration Protocol (DHCP forshort) data packet used to automatically allocate an IP address.

In some embodiments, whether a data packet belongs to the data packetused to manage an IP address may be determined, based on informationsuch as a port number and some specific fields, by parsing the datapacket. Certainly, determining may be performed in another manner. Thisis not in some embodiments limited in this application. After the statusof the data service switch of the UE is that the data service switch isturned off, it may be ensured that the data packet of the specified typecan be continuously forwarded without affecting an important service.

For example, if the PGW receives a data packet 1 that goes to the UE,and obtains a port number UDP67/68 corresponding to the data packet 1 byparsing the data packet 1, the data packet 1 may be determined as a DHCPdata packet.

When the status of the data service switch of the UE is that the dataservice switch is turned off, the PGW continues forwarding the datapacket that comes from or goes to the UE and that is used to manage anIP address, thereby ensuring that an IP address management service issmoothly performed after the status of the data service switch of the UEis that the data service switch is turned off.

(4) A data packet of a specified service type, such as a voice over LTEVoLTE service or a rich communication suite RCS service. For example,the specified service type of the UE is stored in the HSS of the UE, andthe PGW receives and stores the specified service type sent by the HSSof the UE. Alternatively, an operator directly configures the specifiedservice type and stores the specified service type in the PGW. The PGWdetermines, based on the stored specified service type, whether thefirst data packet is the data packet of the specified service type.After the status of the data service switch of the UE is that the dataservice switch is turned off, it may be ensured that the data packet ofthe specified service type can be continuously forwarded.

In some embodiments, that the PGW determines whether the first datapacket is the data packet of the specified service type may be in someembodiments:

(1) The PGW performs deep packet inspection DPI on the first datapacket.

For the DPI, in addition to analyzing an IP 5-tuple (a source IPaddress, a source port, a destination IP address, a destination IP port,and a transport layer protocol) corresponding to the data packet, anapplication analysis, a user analysis, a network element analysis,traffic management and control, and the like may be further performed onthe data packet. Whether the first data packet is the data packet of thespecified service type may be determined by performing the deep packetinspection on the first data packet.

(2) The PGW determines, based on service type indication informationincluded in the first data packet, whether the first data packet is thedata packet of the specified service type.

For example, the RCS service server or the UE may set a DSCP field in anRCS service data packet to a special value, and after receiving the datapacket, the PGW may determine, based on the DSCP being the specifiedspecial value, that the data packet is an RCS service data packet.

In some embodiments, step 202 may include:

when the PGW determines that a service registration status of the UE isIMS registration state, determining, by the PGW, whether the first datapacket belongs to the specified type.

The PGW may determine the service registration status of the UE based onindication information that indicates the service registration status ofthe UE and that is sent by the UE by using the MME. For example, the UEmay send a service establishment message (the service establishmentmessage may be an attach request message, a bearer resource changemessage, a PDN connection establishment request message, or the like) tothe MME. The service establishment message includes the serviceregistration status indication information, and the service registrationstatus indication information is used to indicate the serviceregistration status of the UE. In some embodiments, the UE may addservice registration status indication information to a PCO sent to theMME, and the service registration status indication information is usedto indicate the service registration status of the UE. The MMEtransparently transmits the PCO to the SGW by using the serviceestablishment message. The SGW then transparently transmits the PCO tothe PGW by using the service establishment message. After obtaining thePCO, the PGW obtains the service registration status indicationinformation carried in the PCO. In this way, the PGW learns of theservice registration status of the UE. When the PGW determines that theservice registration status of the UE is the IMS registration state, thePGW determines whether the first data packet belongs to the specifiedtype. In this embodiment of this application, the data packet of thespecified type is considered by default as a data packet that is basedon an IMS service. The PGW forwards the data packet of the specifiedtype only when the PGW determines that the service registration statusof the UE is the IMS registration state. During implementation of thisembodiment of this application, the PGW forwards the first data packetof the specified type only when the service registration status of theUE is the IMS registration state. In this way, after the data serviceswitch of the UE is turned off, it may be ensured that the data packetof the IMS service can be normally sent.

In the embodiment shown in FIG. 2a , if the status of the data serviceswitch of the UE is that the data service switch is turned off, afterthe PGW receives the first data packet that comes from or goes to theUE, the PGW determines whether the first data packet belongs to thespecified type. The PGW determines, depending on whether the first datapacket belongs to the specified type, whether to forward the first datapacket. The data packet of the specified type is usually a relativelyimportant data packet. After the data service switch of the UE is turnedoff, the PGW still forwards the data packet of the specified type,thereby avoiding that the UE cannot forward the data packet of thespecified type after the data service switch is turned off. Duringimplementation of the method shown in FIG. 2a , after the data serviceswitch of the UE is turned off, it may be ensured that the data packetof the specified type of the UE can still be normally sent without beingaffected by the data service switch.

Also referring to FIG. 2b , FIG. 2b is a schematic flowchart of anotherdata service control method according to an embodiment of thisapplication. FIG. 2b optimizes FIG. 2a . In FIG. 2b , after step 203 orstep 204 is performed, the following step is further performed.

205: When the status of the data service switch is that the data serviceswitch is turned on, and the PGW receives a second data packet thatcomes from or goes to the UE, the PGW forwards the second data packet.

Further, when the status of the data service switch of the UE is thatthe data service switch is turned on, the PGW sends a second statusnotification message to the IP multimedia subsystem IMS network. Thesecond status notification message is used to notify the IMS networkthat the status of the data service switch of the UE is that the dataservice switch is turned on.

In some embodiments, that the PGW sends a second status notificationmessage to the IP multimedia subsystem IMS network may be in someembodiments:

The PGW first sends the second status notification message to the policyand charging rules function (PCRF for short), and the PCRF then forwardsthe second status notification message to the IP multimedia subsystemIMS network.

The PGW may notify the status of the data service switch of the UE tothe IMS network, so that the IMS network determines, based on the statusof the data service switch of the UE, whether to continue sending datato the UE.

In some embodiments, after step 205 is performed, the following step maybe further performed:

notifying, by the PGW, a charging system that the status of the dataservice switch of the UE is that the data service switch is turned on.

In some embodiments, a manner used by the PGW to notify the chargingsystem that the status of the data service switch of the UE is that thedata service switch is turned on may be in some embodiments:

adding, by the PGW, second indication information to a charging datarecord CDR generated according to the second data packet, where thesecond indication information is used to notify the charging system thatthe data service switch of the UE is turned on; or

notifying, by the PGW in a second credit control request CCR (CCR forshort) message, the charging system that the data service switch of theUE is turned on.

In this embodiment of this application, after step 203 or step 204 isperformed, step 205 is performed. When the status of the data serviceswitch is that the data service switch is turned on, and the PGWreceives the second data packet that comes from or goes to the UE, thePGW forwards the second data packet.

During implementation of the method shown in FIG. 2b , after the statusof the data service switch of the UE is switched from being turned offto being turned on, and the PGW receives the second data packet thatcomes from or goes to the UE, the PGW may directly forward the seconddata packet that comes from or goes to the UE. After the data serviceswitch of the UE is turned on, the PGW may charge, according to a normalcharging standard, for traffic generated according to the second datapacket that comes from or goes to the UE. After the status of the dataservice switch of the UE is switched from being turned off to beingturned on, the PGW may resume an original charging operation.

Also referring to FIG. 2c , FIG. 2c is a schematic flowchart of anotherdata service control method according to an embodiment of thisapplication. FIG. 2c optimizes FIG. 2a . In FIG. 2c , after step 203 isperformed, the following steps are further performed.

206: The PGW notifies a charging system that the status of the dataservice switch of the UE is that the data service switch is turned off.

Step 206 may in some embodiments include:

adding, by the PGW, first indication information to a charging datarecord CDR generated according to the first data packet, where the firstindication information is used to notify the charging system that thedata service switch of the UE is turned off; or

notifying, by the PGW in a first credit control request CCR message, thecharging system that the data service switch of the UE is turned off.

In this embodiment of this application, if the status of the dataservice switch of the UE is that the data service switch is turned off,after the PGW receives the first data packet that comes from or goes tothe UE, the PGW determines whether the first data packet belongs to thespecified type. The PGW forwards the first data packet if yes. After thePGW forwards the first data packet, the PGW adds the first indicationinformation to the CDR generated according to the first data packet. Thefirst indication information is used to notify the charging system thatthe data service switch of the UE is turned off. In this embodiment ofthis application, the PGW notifies the charging system that the dataservice switch of the UE is turned off, so that the charging systemcharges for the first data packet according to a charging standard usedafter the data service switch of the UE is turned off. The chargingsystem may determine whether to charge for the first data packet.

207: When the status of the data service switch is that the data serviceswitch is turned on, and the PGW receives a third data packet that comesfrom or goes to the UE, the PGW forwards the third data packet, and thePGW notifies the charging system that the status of the data serviceswitch of the UE is that the data service switch is turned on.

In some embodiments, a manner used by the PGW to notify the chargingsystem that the status of the data service switch of the UE is that thedata service switch is turned on is in some embodiments:

adding, by the PGW, third indication information to a CDR generatedaccording to the third data packet, where the third indicationinformation is used to notify the charging system that the data serviceswitch of the UE is turned on; or notifying, by the PGW in a secondcredit control request CCR (CCR for short) message, the charging systemthat the data service switch of the UE is turned on.

In this embodiment of this application, after step 206 is performed,step 207 may be performed. After the status of the data service switchof the UE is switched from being turned off to being turned on, and thePGW receives a third data packet that comes from or goes to the UE, thePGW may forward the third data packet, and add the third indicationinformation to the CDR generated according to the third data packet. Thethird indication information is used to notify the charging system thatthe data service switch of the UE is turned on.

Further, when the status of the data service switch of the UE is thatthe data service switch is turned on, the PGW sends a second statusnotification message to the IP multimedia subsystem IMS network. Thesecond status notification message is used to notify the IMS networkthat the status of the data service switch of the UE is that the dataservice switch is turned on.

In some embodiments, that the PGW sends a second status notificationmessage to the IP multimedia subsystem IMS network may be in someembodiments:

the PGW first sends the second status notification message to the policyand charging rules function (PCRF for short), and the PCRF then forwardsthe second status notification message to the IP multimedia subsystemIMS network.

The PGW may notify the status of the data service switch of the UE tothe IMS network, so that the IMS network determines, based on the statusof the data service switch of the UE, whether to continue sending datato the UE.

In some embodiments, after the status of the data service switch of theUE is that the data service switch is turned on, the PGW notifies thecharging system that the status of the data service switch of the UE isthat the data service switch is turned on.

In some embodiments, a manner used by the PGW to notify the chargingsystem that the status of the data service switch of the UE is that thedata service switch is turned on may be in some embodiments:

adding, by the PGW, second indication information to a charging datarecord CDR generated according to the second data packet, where thesecond indication information is used to notify the charging system thatthe data service switch of the UE is turned on; or

notifying, by the PGW in a second credit control request CCR (CCR forshort) message, the charging system that the data service switch of theUE is turned on.

During implementation of the method shown in FIG. 2c , after the statusof the data service switch of the UE is switched from being turned offto being turned on, the charging system may be notified that the dataservice switch of the UE is turned on, so that the charging systemcharges for the third data packet according to a charging standard usedafter the data service switch of the UE is turned on.

Referring to FIG. 3, FIG. 3 is a schematic flowchart of another dataservice control method according to an embodiment of this application.As shown in FIG. 3, the method includes the following steps.

301: A packet data network gateway PGW determines a status of a dataservice switch of user equipment UE, where the status of the dataservice switch includes that the data service switch is turned on orthat the data service switch is turned off.

For step 301 in this embodiment of this application, refer to step 201in FIG. 2a . Details are not described again in this embodiment of thisapplication.

302: When the status of the data service switch is that the data serviceswitch is turned off, and the PGW receives a first data packet thatcomes from or goes to the UE, the PGW determines whether a serviceregistration status of the UE is only a circuit switched fallback CSFBcombined registration state or only an evolved packet system EPSregistration state; and if yes, perform step 303, where only the CSFBcombined registration state includes a state that the UE is registeredwith both a circuit switched CS network and an EPS network, but is notregistered with an IP multimedia subsystem IMS network.

In this embodiment of this application, if the status of the dataservice switch of the UE is that the data service switch is turned off,after the PGW receives the first data packet that comes from or goes tothe UE, the PGW forwards or discards the first data packet based on theservice registration status of the first data packet. In someembodiments, if the status of the data service switch of the UE is thatthe data service switch is turned off, after the PGW receives the firstdata packet that comes from or goes to the UE, the PGW determineswhether the service registration status of the UE is only the circuitswitched fallback CSFB combined registration state or only the evolvedpacket system EPS registration state. If yes, the PGW discards the firstdata packet. Only the CSFB combined registration state includes a statethat in a registration process, the UE is registered with both the CSnetwork and the EPS network, but is not registered with the IMS network.When the UE is in only the CSFB combined registration state, the UE mayuse a 4G data service and a 2G/3G voice service, and when the dataservice switch of the UE is turned off, the UE cannot use the 4G dataservice, but may still use a CSFB voice service. When the UE is in onlythe EPS registration state, the UE may use only the 4G data service, andwhen the data service switch of the UE is turned off, the UE cannot usethe 4G data service.

In some embodiments, step 302 may include: when the PGW determines thatthe first data packet is not a data packet used to manage an IP address,determining, by the PGW, whether the service registration status of theUE is only the CSFB combined registration state or only the EPSregistration state.

In this embodiment of this application, the data packet used to managean IP address is an important data packet of the UE, and should not beeasily discarded. When the PGW determines that the first data packet isnot the data packet used to manage an IP address, and the PGW determinesthat the service registration status of the UE is only the CSFB combinedregistration state or only the EPS registration state, the PGW discardsthe first data packet. When preparing to discard a data packet, the PGWfirst determines whether the data packet is the data packet used tomanage an IP address. If no, the PGW discards the data packet. In thisway, it may be ensured that an important data packet can be normallyreceived and sent after the data service switch of the UE is turned off.

In some embodiments, step 302 may include: receiving, by the PGW, a PCOsent by the UE by using an MME, where the PCO includes serviceregistration status indication information; and determining, by the PGW,whether the service registration status indication information indicatesthat the UE is in only the CSFB combined registration state or in onlythe EPS registration state.

In this embodiment of this application, the PGW determines, based on theservice registration status indication information in the PCO sent bythe UE, whether the UE is in only the CSFB combined registration stateor in only the EPS registration state. When the UE is in only the CSFBcombined registration state or in only the EPS registration state, thePGW may be notified of the service registration status of the UE in timeby using the PCO. The UE may send a service establishment message (theservice establishment message may be an attach request message, a bearerresource change message, a PDN connection establishment request message,or the like) to the MME. The service establishment message includes theservice registration status indication information, and the serviceregistration status indication information is used to indicate theservice registration status of the UE. In some embodiments, the UE mayadd the service registration status indication information to the PCOsent to the MME, and the service registration status indicationinformation is used to indicate the service registration status of theUE. The MME transparently transmits the PCO to an SGW by using theservice establishment message. The SGW then transparently transmits thePCO to the PGW by using the service establishment message. Afterobtaining the PCO, the PGW obtains the service registration statusindication information carried in the PCO. The PGW determines whetherthe service registration status indication information indicates thatthe UE is in only the CSFB combined registration state or in only theEPS registration state. If yes, step 303 is performed.

303: The PGW discards the first data packet.

During implementation of the method shown in FIG. 3, when the dataservice switch of the UE is turned off, when the PGW determines that theservice registration status of the UE is only the CSFB combinedregistration state or only the EPS registration state, the first datapacket that is received by the PGW and that comes from or goes to the UEis a data packet of a 3G or 4G data service. To save traffic of the UE,the PGW directly discards the first data packet.

304: When the status of the data service switch is that the data serviceswitch is turned on, and the PGW receives a second data packet thatcomes from or goes to the UE, the PGW forwards the second data packet.

In this embodiment of this application, after step 303 is performed,step 304 may be performed. When the status of the data service switch isthat the data service switch is turned on, and the PGW receives thesecond data packet that comes from or goes to the UE, the PGW forwardsthe second data packet. After the data service switch of the UE isturned on, the PGW may charge, according to a normal charging standard,for the second data packet that comes from or goes to the UE. After thestatus of the data service switch of the UE is switched from beingturned off to being turned on, the PGW resumes an original forwardingoperation.

Referring to FIG. 4, FIG. 4 is a schematic flowchart of another dataservice control method according to an embodiment of this application.As shown in FIG. 4, the method includes the following steps.

401: A packet data network gateway PGW determines a status of a dataservice switch of user equipment UE, where the status of the dataservice switch includes that the data service switch is turned on orthat the data service switch is turned off.

For step 401 in this embodiment of this application, refer to step 201in FIG. 2a . Details are not described again in this embodiment of thisapplication.

402: When the status of the data service switch is that the data serviceswitch is turned off, and the PGW receives a first data packet thatcomes from or goes to the UE, the PGW forwards the first data packet,and the PGW notifies a charging system that the data service switch ofthe UE is turned off. In some embodiments, a manner used by the PGW tonotify the charging system that the data service switch of the UE isturned off is in some embodiments:

adding, by the PGW, first indication information to a charging datarecord CDR generated according to the first data packet, where the firstindication information is used to notify the charging system that thedata service switch of the UE is turned off; or notifying, by the PGW ina first credit control request (CCR for short) message, the chargingsystem that the data service switch of the UE is turned off.

In this embodiment of this application, if the status of the dataservice switch of the UE is that the data service switch is turned off,after the PGW receives the first data packet that comes from or goes tothe UE, the PGW directly forwards the first data packet, and the PGWadds the first indication information to the charging data record CDRgenerated according to the first data packet. The first indicationinformation is used to notify the charging system that the data serviceswitch of the UE is turned off. In this embodiment of this application,if the status of the data service switch of the UE is that the dataservice switch is turned off, after the PGW receives the first datapacket that comes from or goes to the UE, the PGW does not charge forthe first data packet, but notifies the charging system that the dataservice switch of the UE is turned off, so that the charging systemcharges for the first data packet according to a charging standard usedafter the data service switch of the UE is turned off, and the chargingsystem determines whether to charge for the first data packet.

403: When the status of the data service switch is that the data serviceswitch is turned on, and the PGW receives a second data packet thatcomes from or goes to the UE, the PGW forwards the second data packet,and the PGW notifies the charging system that the data service switch ofthe UE is turned on. In some embodiments, a manner used by the PGW tonotify the charging system that the data service switch of the UE isturned on is in some embodiments:

adding, by the PGW, second indication information to a CDR generatedaccording to the second data packet, where the second indicationinformation is used to notify the charging system that the data serviceswitch of the UE is turned on; or notifying, by the PGW in a secondcredit control request (CCR for short) message, the charging system thatthe data service switch of the UE is turned on.

In this embodiment of this application, after step 402 is performed,step 403 may be performed. After the status of the data service switchof the UE is switched from being turned off to being turned on, and thePGW receives the second data packet that comes from or goes to the UE,the PGW may forward the second data packet, and add the secondindication information to the CDR generated according to the second datapacket. The second indication information is used to notify the chargingsystem that the data service switch of the UE is turned on. Duringimplementation of this embodiment of this application, after the statusof the data service switch of the UE is switched from being turned offto being turned on, the charging system may be notified that the dataservice switch of the UE is turned on, so that the charging systemcharges for the second data packet according to a charging standard usedafter the data service switch of the UE is turned on.

During implementation of the method shown in FIG. 4, after the dataservice switch of the UE is turned off, after receiving the first datapacket that comes from or goes to the UE, the PGW directly forwards thefirst data packet, and the PGW does not charge for the first datapacket, but notifies the charging system that the data service switch ofthe UE is turned off, so that the charging system charges for the firstdata packet according to the charging standard used after the dataservice switch of the UE is turned off. After the status of the dataservice switch of the UE is switched from being turned off to beingturned on, the charging system is notified that the data service switchof the UE is turned on, so that the charging system charges for thesecond data packet according to the charging standard used after thedata service switch of the UE is turned on.

Referring to FIG. 4a , FIG. 4a is a schematic flowchart of another dataservice control method according to an embodiment of this application.As shown in FIG. 4a , the method includes the following steps.

404: When a packet data network gateway PGW receives a first data packetthat comes from or goes to user equipment UE, the PGW forwards the firstdata packet.

405: The PGW determines whether the first data packet belongs to aspecified type; and if yes, perform step 406.

The specified type may include an uplink data packet that is sent by theUE to a PDN network corresponding to an IMS APN or a downlink datapacket that is sent by a PDN network corresponding to an IMS APN to theUE, a data packet coming from an address of a specified service server(for example, an address of a rich communication suite RCS server) andgoing to the UE, a data packet used to manage an IP address, a datapacket of a specified service type (such as a voice over LTE VoLTEservice or a rich communication suite RCS service), and the like. Thespecified type may be preset by the UE or a network-side device (such asa home subscriber server HSS, a proxy-call session control functionP-CSCF, or an application function AF) and sent to the PGW, or may bepreset and stored by the PGW based on a service registration status ofthe UE.

In some embodiments, the data packet of the specified type may be one ora combination of the following four:

(1) An uplink data packet that is sent by the UE to a packet datanetwork PDN network corresponding to an IMS access point name APN or adownlink data packet that is sent by a PDN network corresponding to anIMS APN to the UE, in other words, an uplink or downlink data packet ofan IMS service of the UE. To ensure that the IMS service can be normallyperformed, after a data service switch of the UE is turned off, the PGWcontinues forwarding the uplink or downlink data packet of the IMSservice.

(2) A data packet coming from an address of a specified service server(for example, an address of a rich communication suite RCS server) andgoing to the UE. The address of the specified service server may bepreset by the UE or the PGW and is stored in the PGW. The PGW determineswhether a source address of the first data packet is the prestoredaddress of the specified service server, and if yes, determines that thefirst data packet belongs to the specified type.

(3) A data packet used to manage an IP address.

The data packet used to manage an IP address is a data packet used tomanage an IP address, allocate an IP address, and the like. For example,the data packet may be a Dynamic Host Configuration Protocol (DHCP forshort) data packet used to automatically allocate an IP address. Foranother example, a user may manage allocation of an IPv6 address, arouter solicitation (RS for short), and a router advertisement (RA forshort).

In some embodiments, whether a data packet belongs to the data packetused to manage an IP address may be determined, based on informationsuch as a port number and some specific fields, by parsing the datapacket. Certainly, determining may be performed in another manner. Thisis not in some embodiments limited in this application. After a statusof the data service switch of the UE is that the data service switch isturned off, it may be ensured that the data packet of the specified typecan be continuously forwarded without affecting an important service.

For example, if the PGW receives a data packet 1 that goes to the UE,and obtains a port number UDP67/68 corresponding to the data packet 1 byparsing the data packet 1, the data packet 1 may be determined as a DHCPdata packet.

After the status of the data service switch of the UE is that the dataservice switch is turned off, the PGW continues forwarding the datapacket that comes from or goes to the UE and that is used to manage anIP address, thereby ensuring that an IP address management service issmoothly performed after the status of the data service switch of the UEis that the data service switch is turned off.

(4) A data packet of a specified service type, such as a voice over LTEVoLTE service or a rich communication suite RCS service. For example,the specified service type of the UE is stored in the HSS of the UE, andthe PGW receives and stores the specified service type sent by the HSSof the UE. Alternatively, an operator directly configures the specifiedservice type and stores the specified service type in the PGW. The PGWdetermines, based on the stored specified service type, whether thefirst data packet is the data packet of the specified service type.After the status of the data service switch of the UE is that the dataservice switch is turned off, it may be ensured that the data packet ofthe specified service type can be continuously forwarded.

In some embodiments, that the PGW determines whether the first datapacket is the data packet of the specified service type may be in someembodiments:

(1) The PGW performs deep packet inspection DPI on the first datapacket.

For the DPI, in addition to analyzing an IP 5-tuple (a source IPaddress, a source port, a destination IP address, a destination IP port,and a transport layer protocol) corresponding to the data packet, anapplication analysis, a user analysis, a network element analysis,traffic management and control, and the like may be further performed onthe data packet. Whether the first data packet is the data packet of thespecified service type may be determined by performing the deep packetinspection on the first data packet.

(2) The PGW determines, based on service type indication informationincluded in the first data packet, whether the first data packet is thedata packet of the specified service type.

For example, the RCS service server or the UE may set a DSCP field in anRCS service data packet to a special value, and after receiving the datapacket, the PGW may determine, based on the DSCP being the specifiedspecial value, that the data packet is an RCS service data packet.

406: The PGW adds fourth indication information to a charging datarecord CDR generated according to the first data packet, where thefourth indication information is used to instruct a charging system notto charge for the first data packet.

In some embodiments, before step 404 is performed, the following stepmay be further performed:

determining, by the PGW, that the status of the data service switch ofthe user equipment UE is that the data service switch is turned off.

When the PGW determines that the status of the data service switch ofthe user equipment UE is that the data service switch is turned off, thePGW forwards the first data packet. When the status of the data serviceswitch of the UE is that the data service switch is turned off, the datapacket may still be forwarded.

In some embodiments, after the PGW determines that the status of thedata service switch of the user equipment UE is that the data serviceswitch is turned off, the following step may be further performed:

adding, by the PGW, first indication information to the charging datarecord CDR generated according to the first data packet, where the firstindication information is used to notify the charging system that thedata service switch of the UE is turned off.

After the PGW determines that the status of the data service switch ofthe UE is that the data service switch is turned off, the PGW notifiesthe charging system that the data service switch of the UE is turnedoff.

Referring to FIG. 4b , FIG. 4b is a schematic flowchart of another dataservice control method according to an embodiment of this application.As shown in FIG. 4b , the method includes the following steps.

407: A packet data network gateway PGW determines a status of a dataservice switch of user equipment UE, where the status of the dataservice switch includes that the data service switch is turned on orthat the data service switch is turned off.

For step 407 in this embodiment of this application, refer to step 201in FIG. 2a . Details are not described again in this embodiment of thisapplication.

408: When the status of the data service switch is that the data serviceswitch is turned off, and the PGW receives a first data packet thatcomes from or goes to the UE, the PGW forwards the first data packet,and adds first indication information to a charging data record CDRgenerated according to the first data packet, where the first indicationinformation is used to notify a charging system that the data serviceswitch of the UE is turned off.

For step 408 in this embodiment of this application, refer to step 402in FIG. 4. Details are not described again in this embodiment of thisapplication.

In some embodiments, before step 408 is performed, the following stepmay be further performed:

determining, by the PGW, that a service registration status of the UE isan IMS registration state.

In some embodiments, the PGW may determine the service registrationstatus of the UE based on indication information that indicates theservice registration status of the UE and that is sent by the UE byusing an MME. For example, the UE may send a service establishmentmessage (the service establishment message may be an attach requestmessage, a bearer resource change message, a PDN connectionestablishment request message, or the like) to the MME. The serviceestablishment message includes service registration status indicationinformation, and the service registration status indication informationis used to indicate the service registration status of the UE. In someembodiments, the UE may add the service registration status indicationinformation to a PCO sent to the MME, and the service registrationstatus indication information is used to indicate the serviceregistration status of the UE. The MME transparently transmits the PCOto an SGW by using the service establishment message. The SGW thentransparently transmits the PCO to the PGW by using the serviceestablishment message. After obtaining the PCO, the PGW obtains theservice registration status indication information carried in the PCO.In this way, the PGW learns of the service registration status of theUE.

In some embodiments, after the charging system receives the chargingdata record CDR generated according to the first data packet coming fromthe PGW, the charging system determines whether the first data packetbelongs to an IMS exempt service.

The IMS exempt service is an operator service set that can still be usedby the UE even if the data service switch of the UE in the IMSregistration state is turned off. The IMS exempt service set may bepre-configured in the charging system.

Based on the first indication information in the charging data recordCDR, the charging system learns that the data service switch of the UEis turned off and learns of a start-stop time period within which thedata service switch of the UE is turned off. The charging system checkswhether the UE uses the IMS exempt service within the period of time. Ifthe UE uses the IMS exempt service, the charging system charges the UE;or otherwise, the charging system does not charge the UE, to bespecific, does not charge for all charging data records CDRs includingthe first indication information.

Concerning how the charging system determines whether the UE uses theIMS exempt service during the turn-off of the data service switch of theUE, in some embodiments, the charging system determines whether there isa record of interaction between the UE and a server that corresponds tothe IMS exempt service. If yes, the UE uses the IMS exempt service. Ifno, the UE does not use the IMS exempt service.

In this embodiment of this application, after the charging systemreceives, from the PGW, the charging data record CDR generated accordingto the first data packet, based on the first indication information inthe charging data record CDR, the charging system learns that the dataservice switch of the UE is turned off and learns of the start-stop timeperiod within which the data service switch of the UE is turned off. Thecharging system checks whether the UE uses the IMS exempt service withinthe period of time. If the UE uses the IMS exempt service, the chargingsystem charges the UE; or otherwise, the charging system does not chargethe UE.

In some embodiments, after step 408 is performed, step 409 may befurther performed.

409: When the status of the data service switch is that the data serviceswitch is turned on, and the PGW receives a second data packet thatcomes from or goes to the UE, the PGW forwards the second data packet,and adds second indication information to a CDR generated according tothe second data packet, where the second indication information is usedto notify the charging system that the data service switch of the UE isturned on.

For step 409 in this embodiment of this application, refer to step 403in FIG. 4. Details are not described again in this embodiment of thisapplication.

Referring to FIG. 5, FIG. 5 is a schematic flowchart of another dataservice control method according to an embodiment of this application.As shown in FIG. 5, the method includes the following steps.

501: UE sends a service establishment message to an MME, where theservice establishment message includes data service switch statusindication information and/or service registration status indicationinformation, the data service switch status indication information isused to indicate a status of a data service switch of the UE to a PGW,the service registration status indication information is used toindicate a service registration status of the UE, and the status of thedata service switch includes that the data service switch is turned onor that the data service switch is turned off.

In this embodiment of this application, the UE may send the serviceestablishment message including the data service switch statusindication information to the MME, or may send the service establishmentmessage including the service registration status indication informationto the MME, or may send the service establishment message including thedata service switch status indication information and the serviceregistration status indication information to the MME. The UE may firstsend a first service establishment message including the data serviceswitch status indication information to the MME, and then send a secondservice establishment message including the service registration statusindication information to the MME; or the UE may first send a firstservice establishment message including the service registration statusindication information to the MME, and then send a second serviceestablishment message including the data service switch statusindication information to the MME. The UE may first send a first serviceestablishment message including the data service switch statusindication information or the service registration status indicationinformation to the MME, and then send a second service establishmentmessage including the data service switch status indication informationand the service registration status indication information to the MME;or the UE may first send a second service establishment messageincluding the data service switch status indication information and theservice registration status indication information to the MME, and thensend a first service establishment message including the data serviceswitch status indication information or the service registration statusindication information to the MME.

The data service switch status indication information is used toindicate the status of the data service switch of the UE. The status ofthe data service switch of the UE includes that the data service switchof the UE is turned on or that the data service switch of the UE isturned off. The service registration status indication information isused to indicate the service registration status of the UE. The serviceregistration status of the UE may include: only a CSFB combinedregistration state, an IMS registration state, only an EPS registrationstate, and the like.

The data service switch status indication information and/or the serviceregistration status indication information are/is used by the PGW todetermine whether to discard the first data packet that is received bythe PGW and that comes from or goes to the UE. After the UE sends theservice establishment message to the MME, the MME may send the dataservice switch status indication information and/or the serviceregistration status indication information in the service establishmentmessage to the PGW. The PGW determines, based on the data service switchstatus indication information and/or the service registration statusindication information, whether to discard the first data packet that isreceived by the PGW and that comes from or goes to the UE. In someembodiments, the service establishment message includes a protocolconfiguration option PCO, and the PCO includes the data service switchstatus indication information and/or the service registration statusindication information. For example, the UE may add the data serviceswitch status indication information and/or the service registrationstatus indication information to the PCO sent to the MME, the MMEtransparently transmits (transparent transmission means that the PCO isnot processed in a transmission process) the PCO to an SGW, the SGW thentransparently transmits the PCO to the PGW, and after obtaining the PCO,the PGW obtains the data service switch status indication informationand/or the service registration status indication information carried inthe PCO. In this way, the PGW learns of the status of the data serviceswitch and/or the service registration status of the UE.

The PGW may forward or discard, based on the status of the data serviceswitch and/or the service registration status of the UE, the first datapacket that comes from or goes to the UE. Alternatively, the PGW maydetermine, based on the status of the data service switch of the UE,whether to add first indication information to a charging data recordCDR generated according to the first data packet that is received by thePGW and that comes from or goes to the UE, and the first indicationinformation is used to notify a charging system that the data serviceswitch of the UE is turned off. For specific implementation details,refer to the embodiment parts of FIG. 2a , FIG. 2b , FIG. 2c , FIG. 3,and FIG. 4.

In this embodiment of this application, the service establishmentmessage may include one or more of an attach request message, a bearerresource change message, and a PDN connection establishment requestmessage. The attach request message includes the data service switchstatus indication information, the bearer resource change messageincludes the data service switch status indication information and/orthe service registration status indication information, and the PDNconnection establishment request message includes the data serviceswitch status indication information and/or the service registrationstatus indication information. When the UE needs to attach to an LTEnetwork, the UE sends the attach request message to the MME. When the UEneeds to request to change a bearer resource, the UE sends the bearerresource change message to the MME. When the UE needs to establish a PDNconnection, the UE sends the PDN connection establishment requestmessage to the MME.

In some embodiments, the service registration status of the UE includes:only the CSFB combined registration state, the IMS registration state,or only the EPS registration state. Only the CSFB combined registrationstate includes a state that in a registration process, the UE isregistered with both a circuit switched CS network and an EPS network,but is not registered with an IMS network. Only the EPS registrationstate includes that in a registration process, the UE is registered withonly the EPS network. The IMS registration state includes that the UE isregistered with the EPS network and the IMS network.

In some embodiments, step 501 may include:

when the UE determines that the status of the data service switchchanges, sending, by the UE, the service establishment message includingthe data service switch status indication information to the MME.

In this embodiment of this application, when a user switches the statusof the data service switch of the UE from being turned on to beingturned off, or a user switches the status of the data service switch ofthe UE from being turned off to being turned on, the UE sends theservice establishment message including the data service switch statusindication information to the MME. For example, when the user switchesthe status of the data service switch of the UE from being turned on tobeing turned off, the UE sends the service establishment message to theMME, the service establishment message includes the data service switchstatus indication information, and the data service switch statusindication information is used to indicate that the data service switchof the UE is turned off. When the user switches the status of the dataservice switch of the UE from being turned off to being turned on, theUE sends the service establishment message to the MME, the serviceestablishment message includes the data service switch status indicationinformation, and the data service switch status indication informationis used to indicate that the data service switch of the UE is turned on.When the status of the data service switch of the UE changes, the UE maynotify the status of the data service switch of the UE to the PGW intime.

In some embodiments, step 501 may include:

when the UE determines that the service registration status changes,sending, by the UE, the service establishment message including theservice registration status indication information to the MME.

In this embodiment of this application, when the service registrationstatus of the UE changes, for example, when the service registrationstatus of the UE changes from only the EPS registration state to onlythe CSFB combined registration state, the UE sends the serviceestablishment message including the service registration statusindication information to the MME, and the service registration statusindication information is used to indicate that the service registrationstatus of the UE is only the CSFB combined registration state. When theservice registration status of the UE changes from only the CSFBcombined registration state to only the EPS registration state, the UEsends the service establishment message including the serviceregistration status indication information to the MME, and the serviceregistration status indication information is used to indicate that theservice registration status of the UE is only the EPS registrationstate. When the service registration status of the UE changes, the UEmay notify the service registration status of the UE to the PGW in time.

In some embodiments, step 501 may include:

when the UE determines that both the status of the data service switchand the service registration status change, sending, by the UE, theservice establishment message including the data service switch statusindication information and the service registration status indicationinformation to the MME.

For example, when the UE determines that the status of the data serviceswitch is switched from being turned on to being turned off, and theservice registration status changes from only the EPS registration stateto only the CSFB combined registration state, the UE sends the serviceestablishment message including the data service switch statusindication information and the service registration status indicationinformation to the MME, the data service switch status indicationinformation is used to indicate that the data service switch of the UEis turned off, and the service registration status indicationinformation is used to indicate that the service registration status ofthe UE is only the CSFB combined registration state. When both thestatus of the data service switch and the service registration status ofthe UE change, the UE may notify the status of the data service switchand the service registration status of the UE to the PGW in time.

In some embodiments, step 501 may include:

when the UE determines that a default APN PDN connection is successfullyestablished, and the UE determines that CSFB combined registration iscompleted, sending, by the UE, the service establishment message to theMME, where the service establishment message includes the serviceregistration status indication information, and the service registrationstatus indication information is used to indicate that the serviceregistration status of the UE is only the CSFB combined registrationstate.

In this embodiment of this application, when the default APN PDNconnection is successfully established, and the UE determines that theCSFB combined registration is completed, the UE can perform a servicethat is based on the default APN PDN connection.

In some embodiments, step 501 may include:

when the UE determines that an IMS APN PDN connection is successfullyestablished, and the UE determines that IMS registration succeeds,sending, by the UE, the service establishment message to the MME, wherethe service establishment message includes the service registrationstatus indication information, and the service registration statusindication information is used to indicate that the service registrationstatus of the UE is the IMS registration state.

In this embodiment of this application, when the IMS APN PDN connectionis successfully established, and the UE determines that the IMSregistration succeeds, the UE can perform a service that is based on theIMS APN PDN connection.

Further, when the UE moves from a Long Term Evolution (LTE for short)network to a 2/3G network, the UE accesses the 2/3G network, and whenthe UE determines that the status of the data service switch of the UEis a turned-off state, the UE sends a PDP deactivation message to aserving GPRS support node SGSN of the 2/3G network, to delete a PDPcontext of the UE; or the UE sends a routing area update message to aserving GPRS support node SGSN of the 2/3G network, where the routingarea update message carries the status of the data service switch of theUE.

When the UE moves from the 2/3G network to the Long Term Evolutionnetwork, the UE accesses the Long Term Evolution network. When the UEdetermines that the status of the data service switch of the UE is thatthe data service switch is turned off, the UE sends an attach message tothe MME, to access the Long Term Evolution network.

502: The MME forwards the data service switch status indicationinformation and/or the service registration status indicationinformation to the PGW.

In this embodiment of this application, after the MME receives theservice establishment message sent by the UE, the MME extracts the dataservice switch status indication information and/or the serviceregistration status indication information from the serviceestablishment message, and the MME forwards the data service switchstatus indication information and/or the service registration statusindication information to the PGW.

In some embodiments, step 502 may include:

transferring, by the MME, the status of the data service switch and/orthe service registration status to the packet data network gateway PGWby using the PCO.

In this embodiment of this application, in some embodiments, the MMEtransparently transmits the status of the data service switch and/or theservice registration status to the SGW by using the PCO (transparenttransmission means that the PCO is not processed in a transmissionprocess), and the SGW then transparently transmits the status of thedata service switch and/or the service registration status to the PGW byusing the PCO. The UE may transmit the status of the data service switchand/or the service registration status of the UE by using the PCO,thereby improving transmission security.

503: The PGW determines the status of the data service switch and/or theservice registration status of the UE based on the data service switchstatus indication information and/or the service registration statusindication information.

In this embodiment of this application, after the PGW receives the dataservice switch status indication information and/or the serviceregistration status indication information sent by the MME, the PGWdetermines the status of the data service switch of the UE based on thedata service switch status indication information used to indicate thestatus of the data service switch of the UE, and the PGW determines theservice registration status of the UE based on the service registrationstatus indication information used to indicate the service registrationstatus of the UE.

During implementation of the method shown in FIG. 5, the UE may send theservice establishment message including the data service switch statusindication information and/or the service registration status indicationinformation to the MME, the MME forwards the data service switch statusindication information and/or the service registration status indicationinformation to the PGW, and the PGW determines the status of the dataservice switch and/or the service registration status of the UE based onthe data service switch status indication information and/or the serviceregistration status indication information. The UE may notify the statusof the data service switch and/or the service registration status of theUE to the PGW.

Referring to FIG. 6, FIG. 6 is a schematic structural diagram of UEaccording to an embodiment of this application. As shown in FIG. 6, theUE 600 may include a sending unit 601.

The sending unit 601 is configured to send a service establishmentmessage to an MME. The service establishment message includes dataservice switch status indication information and/or service registrationstatus indication information, the data service switch status indicationinformation is used to indicate a status of a data service switch of theUE, the status of the data service switch includes that the data serviceswitch is turned on or that the data service switch is turned off, andthe service registration status indication information is used toindicate a service registration status of the UE.

During implementation of the UE shown in FIG. 6, the UE may notify thestatus of the data service switch and/or the service registration statusof the UE to a PGW by using the MME.

Based on the same inventive concept, a principle used by the UE toresolve a problem is similar to the data service control method in themethod embodiment of this application. Therefore, for the implementationof the UE, refer to the implementation of the method. Repeated contentis not described again.

Referring to FIG. 7, FIG. 7 is a schematic structural diagram of a PGWaccording to an embodiment of this application. The PGW 700 shown inFIG. 7 includes: at least one processor 701, such as a CPU, at least onenetwork interface 702, a memory 703, and at least one communications bus704. The communications bus 704 is configured to implement connectionand communication between these components. The network interface 702may be a wired interface, such as a fiber distributed data interface(FDDI for short) or a Gigabit Ethernet (GE for short) interface.Alternatively, the network interface 702 may be a wireless interface.The memory 703 includes, but is not limited to, a random access memory(RAM), a read-only memory (ROM), an erasable programmable read-onlymemory (EPROM or a flash memory), or a portable read-only memory(CD-ROM). The processor 701 may include one or more central processingunits (CPU for short). When the processor 701 is one CPU, the CPU may bea single-core CPU, or may be a multi-core CPU. The memory 703 isconfigured to store a program and data.

In this embodiment of this application, the network interface 702 isconfigured to receive a first data packet that comes from or goes to UE.

The processor 701 is configured to determine a status of a data serviceswitch of the user equipment UE. The status of the data service switchincludes that the data service switch is turned on or that the dataservice switch is turned off.

The processor 701 is further configured to: when the processor 701determines that the status of the data service switch is that the dataservice switch is turned off, and the network interface 702 receives thefirst data packet that comes from or goes to the UE, determine whetherthe first data packet belongs to a specified type.

The processor 701 is further configured to forward the first data packetwhen the processor 701 determines that the first data packet belongs tothe specified type.

The processor 701 is further configured to discard the first data packetwhen the processor 701 determines that the first data packet does notbelong to the specified type.

In an embodiment, that the processor 701 determines whether the firstdata packet belongs to the specified type is in some embodiments:

when the processor 701 determines that a service registration status ofthe UE is an IMS registration state, the processor 701 determineswhether the first data packet belongs to the specified type.

In an embodiment, the processor 701 is further configured to: after theprocessor 701 determines that the service registration status of the UEis the IMS registration state, when the status of the data serviceswitch of the UE is that the data service switch is turned off, send afirst status notification message to a IP multimedia subsystem IMSnetwork by using the network interface 702. The first statusnotification message is used to notify the IMS network that the statusof the data service switch of the UE is that the data service switch isturned off.

In an embodiment, the processor 701 is further configured to:

after the processor 701 forwards the first data packet, notify, by usingthe network interface 702, a charging system that the status of the dataservice switch of the UE is that the data service switch is turned off.

In an embodiment, that the processor 701 notifies, by using the networkinterface 702, the charging system that the status of the data serviceswitch of the UE is that the data service switch is turned off is insome embodiments:

the processor 701 adds first indication information to a charging datarecord CDR generated according to the first data packet, where the firstindication information is used to notify the charging system that thedata service switch of the UE is turned off; or

the processor 701 notifies, in a first credit control request CCRmessage, the charging system that the data service switch of the UE isturned off.

In an embodiment, that the processor 701 determines whether the firstdata packet belongs to the specified type is in some embodiments:

the processor 701 determines whether the first data packet includes oneor more of the following data packets:

an uplink data packet that is sent by the UE to a packet data networkPDN network corresponding to an IMS access point name APN or a downlinkdata packet that is sent by a PDN network corresponding to an IMS APN tothe UE;

a data packet coming from an address of a specified service server andgoing to the UE;

a data packet used to manage an IP address; and

a data packet of a specified service type.

In an embodiment, that the processor 701 determines whether the firstdata packet is the data packet of the specified service type is in someembodiments:

the processor 701 performs deep packet inspection DPI on the first datapacket, and determines whether the first data packet is the data packetof the specified service type; or

the processor 701 determines, based on service type indicationinformation included in the first data packet, whether the first datapacket is the data packet of the specified service type.

In an embodiment, the network interface 702 is further configured toreceive a second data packet that comes from or goes to the UE; and

the processor 701 is further configured to: after the processor 701determines that the status of the data service switch is switched fromthe state that the data service switch is turned off to a state that thedata service switch is turned on, and the network interface 702 receivesthe second data packet that comes from or goes to the UE, forward thesecond data packet.

In an embodiment, the processor 701 is further configured to:

after the processor 701 determines that the service registration statusof the UE is the IMS registration state, when the status of the dataservice switch of the UE is that the data service switch is turned on,send a second status notification message to the IP multimedia subsystemIMS network by using the network interface 702, where the second statusnotification message is used to notify the IMS network that the statusof the data service switch of the UE is that the data service switch isturned on.

In an embodiment, the processor 701 is further configured to: afterforwarding the second data packet, notify, by using the networkinterface 702, the charging system that the status of the data serviceswitch of the UE is that the data service switch is turned on.

In an embodiment, a manner used by the processor 701 to notify, by usingthe network interface 702, the charging system that the status of thedata service switch of the UE is that the data service switch is turnedon is in some embodiments:

adding, by the processor 701, second indication information to acharging data record CDR generated according to the second data packet,where the second indication information is used to notify the chargingsystem that the data service switch of the UE is turned on; or

notifying, by the processor 701 in a second CCR message, the chargingsystem that the data service switch of the UE is turned on.

In an embodiment, the network interface 702 is further configured toreceive a third data packet that comes from or goes to the UE; and

the processor 701 is further configured to: after the processor 701determines that the status of the data service switch is switched fromthe state that the data service switch is turned off to the state thatthe data service switch is turned on, and the network interface 702receives the third data packet that comes from or goes to the UE,forward the third data packet, and add third indication information to aCDR generated according to the third data packet, where the thirdindication information is used to notify the charging system that thedata service switch of the UE is turned on.

In an embodiment, that the processor 701 determines the status of thedata service switch of the UE is in some embodiments:

the processor 701 receives a protocol configuration option PCO sent bythe UE by using a mobility management entity MME, where the PCO includesdata service switch status indication information, and the data serviceswitch status indication information is used to indicate the status ofthe data service switch of the UE.

During implementation of the PGW shown in FIG. 7, when the status of thedata service switch is that the data service switch is turned off, anunnecessary data packet coming from or going to the UE may be discarded,thereby avoiding an unnecessary charge for the UE, and saving datatraffic of the UE. In addition, a necessary data packet (the data packetof the specified type or the data packet used to manage an IP address)is continuously forwarded without affecting an important service andmanagement of an IP address.

Referring to FIG. 7a , FIG. 7a is a schematic structural diagram ofanother PGW according to an embodiment of this application. The PGW 700shown in FIG. 7a includes: at least one processor 701, such as a CPU, atleast one network interface 702, a memory 703, and at least onecommunications bus 704. The communications bus 704 is configured toimplement connection and communication between these components. Thenetwork interface 702 may be a wired interface, such as a fiberdistributed data interface (FDDI for short) or a Gigabit Ethernet (GEfor short) interface. Alternatively, the network interface 702 may be awireless interface. The memory 703 includes, but is not limited to, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or a flash memory), or a portableread-only memory (CD-ROM). The processor 701 may include one or morecentral processing units (CPU for short). When the processor 701 is oneCPU, the CPU may be a single-core CPU, or may be a multi-core CPU. Thememory 703 is configured to store a program and data.

In this embodiment of this application, the network interface 702 isconfigured to receive a first data packet that comes from or goes to UE.

The processor 701 is configured to forward the first data packet.

The processor 701 is further configured to determine whether the firstdata packet belongs to a specified type.

The processor 701 is further configured to: when the first data packetbelongs to the specified type, add fourth indication information to acharging data record CDR generated according to the first data packet.The fourth indication information is used to instruct a charging systemnot to charge for the first data packet.

In an embodiment, that the processor 701 determines whether the firstdata packet belongs to the specified type is in some embodiments:

the processor 701 determines whether the first data packet includes oneor more of the following data packets:

an uplink data packet that is sent by the UE to a packet data networkPDN network corresponding to an IMS access point name APN or a downlinkdata packet that is sent by a PDN network corresponding to an IMS APN tothe UE;

a data packet coming from an address of a specified service server andgoing to the UE;

a data packet used to manage an IP address; and

a data packet of a specified service type.

In an embodiment, a manner used by the processor 701 to determinewhether the first data packet is the data packet of the specifiedservice type is in some embodiments:

performing, by the processor 701, deep packet inspection DPI on thefirst data packet, and determining whether the first data packet is thedata packet of the specified service type; or

determining, by the processor 701 based on service type indicationinformation included in the first data packet, whether the first datapacket is the data packet of the specified service type.

In an embodiment, the processor 701 is further configured to: beforeforwarding the first data packet, determine that a status of a dataservice switch of the user equipment UE is that the data service switchis turned off.

In an embodiment, the processor 701 is further configured to: afterdetermining that the status of the data service switch of the userequipment UE is that the data service switch is turned off, add firstindication information to a charging data record CDR generated accordingto the first data packet. The first indication information is used tonotify the charging system that the data service switch of the UE isturned off.

During implementation of the PGW shown in FIG. 7a , the PGW may notifythe charging system when the status of the data service switch of the UEchanges, the charging system determines whether the UE uses an IMSexempt service during the turn-off of the data service switch, todetermine whether to charge for the UE, and if the UE uses the IMSexempt service during the turn-off of the data service switch, thecharging system charges for the UE; or otherwise, the charging systemdoes not charge for the UE.

Referring to FIG. 7b , FIG. 7b is a schematic structural diagram ofanother PGW according to an embodiment of this application. The PGW 700shown in FIG. 7b includes: at least one processor 701, such as a CPU, atleast one network interface 702, a memory 703, and at least onecommunications bus 704. The communications bus 704 is configured toimplement connection and communication between these components. Thenetwork interface 702 may be a wired interface, such as a fiberdistributed data interface (FDDI for short) or a Gigabit Ethernet (GEfor short) interface. Alternatively, the network interface 702 may be awireless interface. The memory 703 includes, but is not limited to, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or a flash memory), or a portableread-only memory (CD-ROM). The processor 701 may include one or morecentral processing units 701 (CPU for short). When the processor 701 isone CPU, the CPU may be a single-core CPU, or may be a multi-core CPU.The memory 703 is configured to store a program and data.

In this embodiment of this application, the network interface 702 isconfigured to receive a first data packet that comes from or goes to UE.

The processor 701 is configured to determine a status of a data serviceswitch of the user equipment UE. The status of the data service switchincludes that the data service switch is turned on or that the dataservice switch is turned off.

The processor 701 is further configured to: when the status of the dataservice switch is that the data service switch is turned off, and thenetwork interface 702 receives the first data packet that comes from orgoes to the UE, forward the first data packet, and add first indicationinformation to a charging data record CDR generated according to thefirst data packet. The first indication information is used to notify acharging system that the data service switch of the UE is turned off.

In an embodiment, the processor 701 is further configured to: beforeforwarding the first data packet, determine that a service registrationstatus of the UE is an IMS registration state.

In an embodiment, the network interface 702 is further configured toreceive a second data packet that comes from or goes to the UE; and

the processor 701 is further configured to: when the status of the dataservice switch is that the data service switch is turned on, and thenetwork interface 702 receives the second data packet that comes from orgoes to the UE, forward the second data packet, and add secondindication information to a CDR generated according to the second datapacket, where the second indication information is used to notify thecharging system that the data service switch of the UE is turned on.

During implementation of the PGW shown in FIG. 7b , after the dataservice switch of the UE is turned off, after receiving the first datapacket that comes from or goes to the UE, the PGW directly forwards thefirst data packet, and the PGW does not charge for the first datapacket, but notifies the charging system that the data service switch ofthe UE is turned off, so that the charging system charges for the firstdata packet according to a charging standard used after the data serviceswitch of the UE is turned off. After the status of the data serviceswitch of the UE is switched from being turned off to being turned on,the charging system is notified that the data service switch of the UEis turned on, so that the charging system charges for the second datapacket according to a charging standard used after the data serviceswitch of the UE is turned on.

Referring to FIG. 8, FIG. 8 is a schematic structural diagram of anotherUE according to an embodiment of this application. The UE 800 shown inFIG. 8 includes: at least one processor 801, such as a CPU, at least onenetwork interface 802, a memory 803, and at least one communications bus804. The communications bus 804 is configured to implement connectionand communication between these components. The network interface 802may be a wired interface, such as a fiber distributed data interface(FDDI for short) or a Gigabit Ethernet (GE for short) interface.Alternatively, the network interface 802 may be a wireless interface.The memory 803 includes, but is not limited to, a random access memory(RAM), a read-only memory (ROM), an erasable programmable read-onlymemory (EPROM or a flash memory), or a portable read-only memory(CD-ROM). The processor 801 may include one or more central processingunits (CPU for short). When the processor 801 is one CPU, the CPU may bea single-core CPU, or may be a multi-core CPU. The memory 803 isconfigured to store a program and data.

In this embodiment of this application, the network interface 802 isconfigured to send a service establishment message to an MME.

The processor 801 is configured to send the service establishmentmessage to the MME by using the network interface 802.

The service establishment message includes data service switch statusindication information and/or service registration status indicationinformation. The data service switch status indication informationand/or the service registration status indication information are/isused by a PGW to determine whether to discard the first data packet thatis received by the PGW and that comes from or goes to the UE. The dataservice switch status indication information is used to indicate astatus of a data service switch of the UE. The status of the dataservice switch includes that the data service switch is turned on orthat the data service switch is turned off. The service registrationstatus indication information is used to indicate a service registrationstatus of the UE.

In an embodiment, the service registration status of the UE includes:only a CSFB combined registration state, an IMS registration state, oronly an EPS registration state. Only the CSFB combined registrationstate includes a state that in a registration process, the UE isregistered with both a circuit switched CS network and an EPS network,but is not registered with an IMS network.

In an embodiment, the processor 801 is further configured to determinewhether the status of the data service switch of the UE changes, and theprocessor 801 is further configured to determine whether the serviceregistration status of the UE changes; and

that the processor 801 sends the service establishment message to theMME by using the network interface 802 is in some embodiments:

when the processor 801 determines that the status of the data serviceswitch changes, the processor 801 sends, by using the network interface802, the service establishment message including the data service switchstatus indication information to the MME; or

when the processor 801 determines that the service registration statuschanges, the processor 801 sends, by using the network interface 802,the service establishment message including the service registrationstatus indication information to the MME; or

when the processor 801 determines that both the status of the dataservice switch and the service registration status change, the processor801 sends, by using the network interface 802, the service establishmentmessage including the data service switch status indication informationand the service registration status indication information to the MME.

In an embodiment, the processor 801 is further configured to determinewhether a default APN PDN connection is successfully established;

the processor 801 is further configured to determine whether CSFBcombined registration is completed; and

that the processor 801 sends the service establishment message to theMME by using the network interface 802 is in some embodiments:

when the processor 801 determines that the default APN PDN connection issuccessfully established, and the processor 801 determines that the CSFBcombined registration is completed, the processor 801 sends the serviceestablishment message to the MME by using the network interface 802,where the service establishment message includes the serviceregistration status indication information, and the service registrationstatus indication information is used to indicate that the serviceregistration status of the UE is only the CSFB combined registrationstate.

In an embodiment, the processor 801 is further configured to determinewhether an IMS APN PDN connection is successfully established;

the processor 801 is further configured to determine whether IMSregistration succeeds; and

that the processor 801 sends the service establishment message to theMME by using the network interface 802 is in some embodiments:

when the processor 801 determines that the IMS APN PDN connection issuccessfully established, and the processor 801 determines that the IMSregistration succeeds, the processor 801 sends the service establishmentmessage to the MME by using the network interface 802, where the serviceestablishment message includes the service registration statusindication information, and the service registration status indicationinformation is used to indicate that the service registration status ofthe UE is the IMS registration state.

In an embodiment, the service establishment message includes a protocolconfiguration option PCO, and the PCO includes the data service switchstatus indication information and/or the service registration statusindication information.

In an embodiment, the service establishment message may include one ormore of an attach request message, a bearer resource change message, anda PDN connection establishment request message. The attach requestmessage includes the data service switch status indication information,the bearer resource change message includes the data service switchstatus indication information and/or the service registration statusindication information, and the PDN connection establishment requestmessage includes the data service switch status indication informationand/or the service registration status indication information.

In an embodiment, the processor 801 is further configured to: when theUE moves from a Long Term Evolution network to a 2/3G network, accessthe 2/3G network by using the network interface 802; and

the processor 801 is further configured to: when determining that thestatus of the data service switch of the UE is that the data serviceswitch is turned off, send a Packet Data Protocol PDP deactivationmessage to a serving GPRS support node SGSN of the 2/3G network by usingthe network interface 802, to delete a PDP context of the UE; or

the processor 801 is further configured to send a routing area updatemessage to a serving GPRS support node SGSN of the 2/3G network by usingthe network interface 802, where the routing area update message carriesthe status of the data service switch of the UE.

In an embodiment, the processor 801 is further configured to: when theUE moves from the 2/3G network to the Long Term Evolution network,access the Long Term Evolution network by using the network interface802; and

the processor 801 is further configured to: when determining that thestatus of the data service switch of the UE is that the data serviceswitch is turned off, send an attach message to the MME by using thenetwork interface 802.

During implementation of the UE shown in FIG. 8, the UE may notify thestatus of the data service switch and/or the service registration statusof the UE to the PGW.

Persons of ordinary skill in the art may understand that, all or a partof the steps in each method of the foregoing embodiments may beimplemented by a program instructing related hardware. The program maybe stored in a computer readable storage medium. The storage mediumincludes a read-only memory (ROM for short), a random access memory (RAMfor short), a programmable read-only memory (PROM for short), anerasable programmable read-only memory (EPROM for short), a one-timeprogrammable read-only memory (OTPROM for short), anelectrically-erasable programmable read-only memory (EEPROM for short),a compact disc read-only memory (CD-ROM for short) or another opticaldisc memory, magnetic disk memory, and magnetic tape memory, or anyother computer readable medium that can be configured to carry or storedata.

The data service control method and the related device disclosed in theembodiments of this application are described above in detail. Theprinciple and implementations of this application are described hereinthrough specific examples. The description about the embodiments ismerely provided to help understand the method and core ideas of thisapplication. In addition, persons of ordinary skill in the art can makemodifications to this application in terms of the specificimplementations and application scopes based on the ideas of thisapplication. To sum up, the content of specification shall not beconstrued as a limit to this application.

What is claimed is:
 1. A method, comprising: determining, by a gateway,a status of a data service switch of user equipment (UE), wherein thestatus of the data service switch comprises that the data service switchis turned on or that the data service switch is turned off; determining,by the gateway, whether a data packet belongs to a specified servicetype when the status of the data service switch is that the data serviceswitch is turned off; and sending, by the gateway, charging data recordgenerated according to the data packet to a charging system, wherein thecharging data record comprises indication information which notifies thecharging system that the data service switch of the UE is turned off. 2.The method according to claim 1, wherein the determining the status ofthe data service switch of the UE comprises: receiving, by the gateway,a protocol configuration option, from a mobility management entity,wherein the protocol configuration option comprises data service switchstatus indication information, and the data service switch statusindication information indicating the status of the data service switchof the UE.
 3. A method, comprising: determining, by a gateway, a statusof a data service switch of user equipment (UE), wherein the status ofthe data service switch comprises that the data service switch is turnedon or that the data service switch is turned off; determining, by thegateway, whether a data packet belongs to a specified service type whenthe status of the data service switch is that the data service switch isturned off; sending, by the gateway, charging data record generatedaccording to the data packet to a charging system, wherein the chargingdata record comprises indication information which notifies the chargingsystem that the data service switch of the UE is turned off; receiving,by the charging system, the charging data record; and charging, by thecharging system, the data packet according to the indicationinformation.
 4. The method according to claim 3, wherein the determiningthe status of the data service switch of the UE comprises: receiving, bythe gateway, a protocol configuration option, from a mobility managemententity, wherein the protocol configuration option comprises data serviceswitch status indication information, and the data service switch statusindication information indicating the status of the data service switchof the UE.
 5. The method according to claim 3, wherein the data packetis a data packet not charged by the charging system.
 6. An apparatus,comprising at least one processor coupled with a memory, wherein the atleast one processor is configured to execute instructions stored in thememory, to enable the apparatus to perform the following operations:determining a status of a data service switch of user equipment (UE),wherein the status of the data service switch comprises that the dataservice switch is turned on or that the data service switch is turnedoff; determining whether a data packet belongs to a specified servicetype when the status of the data service switch is that the data serviceswitch is turned off; and sending charging data record generatedaccording to the data packet to a charging system, wherein the chargingdata record comprises indication information which notifies the chargingsystem that the data service switch of the UE is turned off.
 7. Theapparatus according to claim 6, wherein the determining the status ofthe data service switch of the UE comprises: receiving a protocolconfiguration option from a mobility management entity, wherein theprotocol configuration option comprises data service switch statusindication information, and the data service switch status indicationinformation indicating the status of the data service switch of the UE.8. A non-transitory computer-readable storage medium storing a programto be executed by at least one processor of a device, the programincluding instructions to cause the device to carry out the followingoperations: determining a status of a data service switch of userequipment (UE), wherein the status of the data service switch comprisesthat the data service switch is turned on or that the data serviceswitch is turned off; determining whether a data packet belongs to aspecified service type when the status of the data service switch isthat the data service switch is turned off; and sending charging datarecord generated according to the data packet to a charging system,wherein the charging data record comprises indication information whichnotifies the charging system that the data service switch of the UE isturned off.
 9. The non-transitory computer-readable storage mediumaccording to claim 8, wherein the determining the status of the dataservice switch of the UE comprises: receiving a protocol configurationoption from a mobility management entity, wherein the protocolconfiguration option comprises data service switch status indicationinformation, and the data service switch status indication informationindicating the status of the data service switch of the UE.
 10. Asystem, comprising: a gateway and a charging system, wherein the gatewaycomprising at least one processor coupled with a memory, wherein the atleast one processor is configured to execute instructions stored in thememory, to enable the apparatus to perform the following operations:determining a status of a data service switch of user equipment (UE),wherein the status of the data service switch comprises that the dataservice switch is turned on or that the data service switch is turnedoff; determining whether a data packet belongs to a specified servicetype when the status of the data service switch is that the data serviceswitch is turned off; and sending charging data record generatedaccording to the data packet to the charging system, wherein thecharging data record comprises indication information which notifies thecharging system that the data service switch of the UE is turned off.11. The system according to claim 10, wherein the charging system isconfigured to receive the charging data record and to charge the datapacket according to the indication information.
 12. The system accordingto claim 10, wherein the determining the status of the data serviceswitch of the UE comprises: receiving a protocol configuration optionfrom a mobility management entity, wherein the protocol configurationoption comprises data service switch status indication information, andthe data service switch status indication information indicating thestatus of the data service switch of the UE.
 13. The system according toclaim 10, wherein the data packet is a data packet not charged by thecharging system.